| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Introductions\Application; |
| 4 |
|
| 5 |
trait User_Allowed_Trait { |
| 6 |
|
| 7 |
/** |
| 8 |
* Determines whether the user has the required capabilities. |
| 9 |
* |
| 10 |
* @param string[] $capabilities The required capabilities. |
| 11 |
* |
| 12 |
* @return bool Whether the user has the required capabilities. |
| 13 |
*/ |
| 14 |
private function is_user_allowed( $capabilities ) { |
| 15 |
foreach ( $capabilities as $capability ) { |
| 16 |
if ( ! \current_user_can( $capability ) ) { |
| 17 |
return false; |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
return true; |
| 22 |
} |
| 23 |
} |
| 24 |
|