| @@ 3497-3505 (lines=9) @@ | ||
| 3494 | * @param string ... Permissions to test |
|
| 3495 | * @return bool True if user is allowed to perform *any* of the given actions |
|
| 3496 | */ |
|
| 3497 | public function isAllowedAny() { |
|
| 3498 | $permissions = func_get_args(); |
|
| 3499 | foreach ( $permissions as $permission ) { |
|
| 3500 | if ( $this->isAllowed( $permission ) ) { |
|
| 3501 | return true; |
|
| 3502 | } |
|
| 3503 | } |
|
| 3504 | return false; |
|
| 3505 | } |
|
| 3506 | ||
| 3507 | /** |
|
| 3508 | * |
|
| @@ 3512-3520 (lines=9) @@ | ||
| 3509 | * @param string ... Permissions to test |
|
| 3510 | * @return bool True if the user is allowed to perform *all* of the given actions |
|
| 3511 | */ |
|
| 3512 | public function isAllowedAll() { |
|
| 3513 | $permissions = func_get_args(); |
|
| 3514 | foreach ( $permissions as $permission ) { |
|
| 3515 | if ( !$this->isAllowed( $permission ) ) { |
|
| 3516 | return false; |
|
| 3517 | } |
|
| 3518 | } |
|
| 3519 | return true; |
|
| 3520 | } |
|
| 3521 | ||
| 3522 | /** |
|
| 3523 | * Internal mechanics of testing a permission |
|