| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\Mcp\Abilities\Utils; |
| 4 |
|
| 5 |
use Elementor\Modules\Components\Components_Access_Controller; |
| 6 |
|
| 7 |
if ( ! defined( 'ABSPATH' ) ) { |
| 8 |
exit; |
| 9 |
} |
| 10 |
|
| 11 |
class Insufficient_Permissions_Error { |
| 12 |
|
| 13 |
public static function for_action( string $action ): \WP_Error { |
| 14 |
return new \WP_Error( |
| 15 |
'insufficient_permissions', |
| 16 |
__( 'You do not have permission to perform this action.', 'elementor' ), |
| 17 |
[ |
| 18 |
'status' => \WP_Http::FORBIDDEN, |
| 19 |
'action' => $action, |
| 20 |
'tier' => Components_Access_Controller::get_access_tier(), |
| 21 |
] |
| 22 |
); |
| 23 |
} |
| 24 |
} |
| 25 |
|