| @@ -17,11 +17,19 @@ | ||
| 17 | 17 | * @var string |
| 18 | 18 | */ |
| 19 | 19 | protected string $rest_base = 'notices'; |
| 20 | 20 | |
| 21 | + /** | |
| 22 | + * Admin-notice dismissal — gated on the umbrella admin-access | |
| 23 | + * cap so any team member who can see the Yatra admin can dismiss | |
| 24 | + * the notices they see. The legacy `manage_yatra` cap was never | |
| 25 | + * registered anywhere, so the previous OR-arm did nothing in | |
| 26 | + * practice. WP admins pass via the Team module's admin-fallback | |
| 27 | + * filter. | |
| 28 | + */ | |
| 21 | 29 | public function check_permission(?\WP_REST_Request $request = null): bool |
| 22 | 30 | { |
| 23 | - return current_user_can('manage_options') || current_user_can('manage_yatra'); | |
| 31 | + return current_user_can('yatra_access_admin'); | |
| 24 | 32 | } |
| 25 | 33 | |
| 26 | 34 | public function register_routes(): void |
| 27 | 35 | { |