| @@ 3358-3366 (lines=9) @@ | ||
| 3355 | * @param string ... Permissions to test |
|
| 3356 | * @return bool True if user is allowed to perform *any* of the given actions |
|
| 3357 | */ |
|
| 3358 | public function isAllowedAny() { |
|
| 3359 | $permissions = func_get_args(); |
|
| 3360 | foreach ( $permissions as $permission ) { |
|
| 3361 | if ( $this->isAllowed( $permission ) ) { |
|
| 3362 | return true; |
|
| 3363 | } |
|
| 3364 | } |
|
| 3365 | return false; |
|
| 3366 | } |
|
| 3367 | ||
| 3368 | /** |
|
| 3369 | * |
|
| @@ 3373-3381 (lines=9) @@ | ||
| 3370 | * @param string ... Permissions to test |
|
| 3371 | * @return bool True if the user is allowed to perform *all* of the given actions |
|
| 3372 | */ |
|
| 3373 | public function isAllowedAll() { |
|
| 3374 | $permissions = func_get_args(); |
|
| 3375 | foreach ( $permissions as $permission ) { |
|
| 3376 | if ( !$this->isAllowed( $permission ) ) { |
|
| 3377 | return false; |
|
| 3378 | } |
|
| 3379 | } |
|
| 3380 | return true; |
|
| 3381 | } |
|
| 3382 | ||
| 3383 | /** |
|
| 3384 | * Internal mechanics of testing a permission |
|