@@ -24,18 +24,18 @@ There are three configuration options that can be defined: `deny`, `regex`, and
Unauthorized will be shown a 403 Forbidden page.
### Deny ###
### `deny` ###
The default action of the filter is to authorize only if an attribute match is found (default allow). When set to TRUE, this option reverses that rule and authorizes the user unless an attribute match is found (default deny), causing an unauthorized action.
Note: This option needs to be boolean (TRUE/FALSE) else it will be considered an attribute matching rule.
### Regex ###
### `regex` ###
Turn regex pattern matching on or off for the attribute values defined. For backwards compatibility, this option defaults to TRUE, but can be turned off by setting it to FALSE.
Note: This option needs to be boolean (TRUE/FALSE) else it will be considered an attribute matching rule.
### Rejection message ###
Optionally provide a localised, custom message to an unauthorised user. This can be used to provide tailored instructions on how to fix the authorisation issue, supply specific contact details, etc.
### `reject_msg` ###
This option can be used to provide a localised, custom message to an unauthorised user. For example: tailored instructions on how to fix the authorisation issue, specific contact details, etc.
It should be an array of key/value pairs, with the keys as the language code. You can use HTML in the message. See below for an example.
...
...
@@ -51,48 +51,53 @@ Note: If regex is enabled, you must use the preg_match format, i.e. you have to
### Examples ###
To use this filter configure it in `config/config.php`:
An alternate way of using this filter is to deny certain users. Or even use multiple filters to create a simple ACL, by first allowing a group of users but then denying a "black list" of users.
'authproc.sp' => [
60 => array[
'class' => 'authorize:Authorize',
'deny' => TRUE,
'uid' => [
'/.*@students.example.edu/',
'/(stu1|stu2|stu3)@example.edu/',
]
```php
'authproc.sp'=>[
60=>array[
'class'=>'authorize:Authorize',
'deny'=>TRUE,
'uid'=>[
'/.*@students.example.edu/',
'/(stu1|stu2|stu3)@example.edu/',
]
]
]
```
The regex pattern matching can be turned off, allowing for exact attribute matching rules. This can be helpful in cases where you know what the value should be. An example of this is with the memberOf attribute or using the ldap:AttributeAddUsersGroups filter with the group attribute.
Additionally, some helpful instructions are shown.