| @@ 3386-3394 (lines=9) @@ | ||
| 3383 | * @param string ... Permissions to test |
|
| 3384 | * @return bool True if user is allowed to perform *any* of the given actions |
|
| 3385 | */ |
|
| 3386 | public function isAllowedAny() { |
|
| 3387 | $permissions = func_get_args(); |
|
| 3388 | foreach ( $permissions as $permission ) { |
|
| 3389 | if ( $this->isAllowed( $permission ) ) { |
|
| 3390 | return true; |
|
| 3391 | } |
|
| 3392 | } |
|
| 3393 | return false; |
|
| 3394 | } |
|
| 3395 | ||
| 3396 | /** |
|
| 3397 | * |
|
| @@ 3401-3409 (lines=9) @@ | ||
| 3398 | * @param string ... Permissions to test |
|
| 3399 | * @return bool True if the user is allowed to perform *all* of the given actions |
|
| 3400 | */ |
|
| 3401 | public function isAllowedAll() { |
|
| 3402 | $permissions = func_get_args(); |
|
| 3403 | foreach ( $permissions as $permission ) { |
|
| 3404 | if ( !$this->isAllowed( $permission ) ) { |
|
| 3405 | return false; |
|
| 3406 | } |
|
| 3407 | } |
|
| 3408 | return true; |
|
| 3409 | } |
|
| 3410 | ||
| 3411 | /** |
|
| 3412 | * Internal mechanics of testing a permission |
|