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