Available in 1.5 1.6 1.7 1.8 1.9 1.10 1.11 stable devel

authorize Module

This module provides an user authorization filter based on regular expressions for those applications that do not cleanly separate authentication from authorization and set some default permissions for authenticated users.

authorize:Authorize
Authorize certain users based on regular expressions.

1 authorize:Authorize

For each attribute you can specify a regular expression string or array of strings. If one of those attributes matches (OR operator) one of the regular expression, the user is authorized successfully.

You must use the preg_match format, i.e. you have to enclose it with a delimiter that does not appear inside the regex (e.g. slash (/), at sign (@), number sign (#) or underscore (_)).

The users not authorized will be shown a 403 Forbidden page.

Problems:

To use this filter configure it in config/config.php:

'authproc.sp' => array(
    60 => array(
        'class' => 'authorize:Authorize',
        'uid'   =>  array(
            '/.*@example.com/',
            '/(user1|user2|user3)@example.edu/',
        ),
        'schacUserStatus' => '@urn:mace:terena.org:userStatus:' .
            'example.org:service:active.*@',
)