Definition at line 8 of file ACL.php.
◆ __construct()
sspmod_core_ACL::__construct |
( |
|
$acl | ) |
|
Initializer for this access control list.
- Parameters
-
array | string | $acl | The access control list. |
Definition at line 23 of file ACL.php.
References $acl, $action, and $rule.
24 assert(
'is_string($acl) || is_array($acl)');
26 if (is_string(
$acl)) {
31 if (!is_array($rule)) {
34 if (count($rule) === 0) {
◆ allows()
sspmod_core_ACL::allows |
( |
array |
$attributes | ) |
|
Match the attributes against the access control list.
- Parameters
-
array | $attributes | The attributes of an user. |
- Returns
- boolean TRUE if the user is allowed to access the resource, FALSE if not.
Definition at line 73 of file ACL.php.
References $action, and $rule.
75 foreach ($this->acl as
$rule) {
◆ getById()
static sspmod_core_ACL::getById |
( |
|
$id | ) |
|
|
staticprivate |
Retrieve an access control list with the given id.
- Parameters
-
string | $id | The id of the access control list. |
- Returns
- array The access control list array.
Definition at line 55 of file ACL.php.
References $config, $id, and SimpleSAML_Configuration\getOptionalConfig().
56 assert(
'is_string($id)');
if(!array_key_exists('StateId', $_REQUEST)) $id
static getOptionalConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
◆ match()
static sspmod_core_ACL::match |
( |
array |
$attributes, |
|
|
array |
$rule |
|
) |
| |
|
staticprivate |
Match the attributes against the given rule.
- Parameters
-
array | $attributes | The attributes of an user. |
array | $rule | The rule we should check. |
- Returns
- boolean TRUE if the rule matches, FALSE if not.
Definition at line 98 of file ACL.php.
100 $op = array_shift(
$rule);
◆ opAnd()
static sspmod_core_ACL::opAnd |
( |
|
$attributes, |
|
|
|
$rule |
|
) |
| |
|
staticprivate |
'and' match operator.
- Parameters
-
array | $attributes | The attributes of an user. |
array | $rule | The rule we should check. |
- Returns
- boolean TRUE if the rule matches, FALSE if not.
Definition at line 134 of file ACL.php.
References $attributes, and $rule.
136 foreach (
$rule as $subRule) {
◆ opEquals()
static sspmod_core_ACL::opEquals |
( |
|
$attributes, |
|
|
|
$rule |
|
) |
| |
|
staticprivate |
'equals' match operator.
- Parameters
-
array | $attributes | The attributes of an user. |
array | $rule | The rule we should check. |
- Returns
- boolean TRUE if the rule matches, FALSE if not.
Definition at line 154 of file ACL.php.
References $attributes, $i, $rule, and array.
156 $attributeName = array_shift(
$rule);
158 if (!array_key_exists($attributeName,
$attributes)) {
159 $attributeValues =
array();
164 foreach (
$rule as $value) {
166 foreach ($attributeValues as
$i => $v) {
170 unset($attributeValues[
$i]);
178 if (!empty($attributeValues)) {
Create styles array
The data for the language used.
◆ opEqualsPreg()
static sspmod_core_ACL::opEqualsPreg |
( |
|
$attributes, |
|
|
|
$rule |
|
) |
| |
|
staticprivate |
'equals-preg' match operator.
- Parameters
-
array | $attributes | The attributes of an user. |
array | $rule | The rule we should check. |
- Returns
- boolean TRUE if the rule matches, FALSE if not.
Definition at line 195 of file ACL.php.
References $attributes, $i, $rule, and array.
197 $attributeName = array_shift(
$rule);
199 if (!array_key_exists($attributeName,
$attributes)) {
200 $attributeValues =
array();
205 foreach (
$rule as $pattern) {
207 foreach ($attributeValues as
$i => $v) {
208 if (!preg_match($pattern, $v)) {
211 unset($attributeValues[
$i]);
220 if (!empty($attributeValues)) {
Create styles array
The data for the language used.
◆ opHas()
static sspmod_core_ACL::opHas |
( |
|
$attributes, |
|
|
|
$rule |
|
) |
| |
|
staticprivate |
'has' match operator.
- Parameters
-
array | $attributes | The attributes of an user. |
array | $rule | The rule we should check. |
- Returns
- boolean TRUE if the rule matches, FALSE if not.
Definition at line 237 of file ACL.php.
References $attributes, $rule, and array.
239 $attributeName = array_shift(
$rule);
241 if (!array_key_exists($attributeName,
$attributes)) {
242 $attributeValues =
array();
247 foreach (
$rule as $value) {
248 if (!in_array($value, $attributeValues, TRUE)) {
Create styles array
The data for the language used.
◆ opHasPreg()
static sspmod_core_ACL::opHasPreg |
( |
|
$attributes, |
|
|
|
$rule |
|
) |
| |
|
staticprivate |
'has-preg' match operator.
- Parameters
-
array | $attributes | The attributes of an user. |
array | $rule | The rule we should check. |
- Returns
- boolean TRUE if the rule matches, FALSE if not.
Definition at line 265 of file ACL.php.
References $attributes, $rule, and array.
267 $attributeName = array_shift(
$rule);
269 if (!array_key_exists($attributeName,
$attributes)) {
270 $attributeValues =
array();
275 foreach (
$rule as $pattern) {
276 $matches = preg_grep($pattern, $attributeValues);
277 if (count($matches) === 0) {
Create styles array
The data for the language used.
◆ opOr()
static sspmod_core_ACL::opOr |
( |
|
$attributes, |
|
|
|
$rule |
|
) |
| |
|
staticprivate |
'or' match operator.
- Parameters
-
array | $attributes | The attributes of an user. |
array | $rule | The rule we should check. |
- Returns
- boolean TRUE if the rule matches, FALSE if not.
Definition at line 294 of file ACL.php.
References $attributes, and $rule.
296 foreach (
$rule as $subRule) {
◆ $acl
The documentation for this class was generated from the following file:
- libs/composer/vendor/simplesamlphp/simplesamlphp/modules/core/lib/ACL.php