| @@ 3420-3428 (lines=9) @@ | ||
| 3417 | * @param string ... Permissions to test |
|
| 3418 | * @return bool True if user is allowed to perform *any* of the given actions |
|
| 3419 | */ |
|
| 3420 | public function isAllowedAny() { |
|
| 3421 | $permissions = func_get_args(); |
|
| 3422 | foreach ( $permissions as $permission ) { |
|
| 3423 | if ( $this->isAllowed( $permission ) ) { |
|
| 3424 | return true; |
|
| 3425 | } |
|
| 3426 | } |
|
| 3427 | return false; |
|
| 3428 | } |
|
| 3429 | ||
| 3430 | /** |
|
| 3431 | * |
|
| @@ 3435-3443 (lines=9) @@ | ||
| 3432 | * @param string ... Permissions to test |
|
| 3433 | * @return bool True if the user is allowed to perform *all* of the given actions |
|
| 3434 | */ |
|
| 3435 | public function isAllowedAll() { |
|
| 3436 | $permissions = func_get_args(); |
|
| 3437 | foreach ( $permissions as $permission ) { |
|
| 3438 | if ( !$this->isAllowed( $permission ) ) { |
|
| 3439 | return false; |
|
| 3440 | } |
|
| 3441 | } |
|
| 3442 | return true; |
|
| 3443 | } |
|
| 3444 | ||
| 3445 | /** |
|
| 3446 | * Internal mechanics of testing a permission |
|