You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Gerard O'Reilly <or...@ssltbivdc.com> on 2002/05/02 11:48:57 UTC

Require a Group but exclude a User


Hi,
I am using htaccess and User Authentication on my Intranet.
I am using Groups and Users but would like to allow access for a Group but exclude a certain User who is a member of the group - can i do this?

Example
<Directory "/home/httpd/html/resources/omt/">
        AuthName "Intranet - restricted area"
        AuthType Basic
        AuthGroupFile /etc/httpd/conf/.grouplist
        AuthUserFile /etc/httpd/conf/passwordfile
#       AuthAuthoritative off
        require group omt
</Directory>

there is a user named intramgr in the group omt who I dont want to have access.  What is or is there a command for this?

Many thanks

Mr. Gerard O'Reilly
Intranet Manager
Siam Stars Ltd/ Thai-Belgium Industrial Co. Ltd
21/6 Moo 3, Soi Kayha Bangbua,
Viphavadee Rangsit Road, 
60 Talad Bangkhen,
Laksi Bangkok 10210
Tel:  +66 (02) 5614649 or (02) 9408750
Fax: +66 (02) 5611486
E-mail: oreilly@ssltbivdc.com

Re: Require a Group but exclude a User

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 2 May 2002, alex dyas wrote:

> Not a very elegant solution, but the first one I could think of:
>
>
> SetEnvIf Remote_User "intramgr" deny_entry
> Deny from env=deny_entry
>

Looks right to me, although I have had some trouble in the past
using SetEnvIf with Remote_User, so you may need to use something like

RerwiteEngine On
RewriteCond %{LA-U:REMOTE_USER} ^intramgr$
RewriteRule .* - [F]

Joshua.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Require a Group but exclude a User

Posted by alex dyas <ad...@twowaytv.co.uk>.
Not a very elegant solution, but the first one I could think of:


SetEnvIf Remote_User "intramgr" deny_entry
Deny from env=deny_entry


See these for more details :

http://httpd.apache.org/docs/mod/mod_setenvif.html#SetEnvIf
http://httpd.apache.org/docs/mod/mod_access.html#allow

alex..

Gerard O'Reilly wrote:
> 
> Hi,
> I am using htaccess and User Authentication on my Intranet.
> I am using Groups and Users but would like to allow access for a Group 
> but exclude a certain User who is a member of the group - can i do this?
>  
> Example
> <Directory "/home/httpd/html/resources/omt/">
>         AuthName "Intranet - restricted area"
>         AuthType Basic
>         AuthGroupFile /etc/httpd/conf/.grouplist
>         AuthUserFile /etc/httpd/conf/passwordfile
> #       AuthAuthoritative off
>         require group omt
> </Directory>
> there is a user named intramgr in the group omt who I dont want to have 
> access.  What is or is there a command for this?
>  
> Many thanks
>  
> Mr. Gerard O'Reilly
> Intranet Manager
> Siam Stars Ltd/ Thai-Belgium Industrial Co. Ltd
> 21/6 Moo 3, Soi Kayha Bangbua,
> Viphavadee Rangsit Road,
> 60 Talad Bangkhen,
> Laksi Bangkok 10210
> Tel:  +66 (02) 5614649 or (02) 9408750
> Fax: +66 (02) 5611486
> E-mail: oreilly@ssltbivdc.com <ma...@ssltbivdc.com>


-- 
-= alex dyas - webmaster - twowaytv - uk =-


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Require a Group but exclude a User

Posted by Rich Bowen <rb...@rcbowen.com>.
On Thu, 2 May 2002, Gerard O'Reilly wrote:

>
>
> Hi,
> I am using htaccess and User Authentication on my Intranet.
> I am using Groups and Users but would like to allow access for a Group but exclude a certain User who is a member of the group - can i do this?
>
> Example
> <Directory "/home/httpd/html/resources/omt/">
>         AuthName "Intranet - restricted area"
>         AuthType Basic
>         AuthGroupFile /etc/httpd/conf/.grouplist
>         AuthUserFile /etc/httpd/conf/passwordfile
> #       AuthAuthoritative off
>         require group omt
> </Directory>
>
> there is a user named intramgr in the group omt who I dont want to have access.  What is or is there a command for this?

Well, the easy answer is that you can create a new group containing the
correct list of people, and excluding the one that you're wanting to
exclude. The Require directive
(http://httpd.apache.org/docs/mod/core.html#require) does not have a
negation argument.

Alternatively, you can write your own auth handler, which is easier than
it sounds.

-- 
Rich Bowen - rbowen@rcbowen.com
Author - Apache Administrator's Guide
http://www.ApacheAdmin.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org