get_param( 'post_id' ); return current_user_can( ABDS_SEO_Activator::CONTENT_CAPABILITY ) && current_user_can( 'edit_post', $post_id ); } /** * Permission callback: current user can manage the plugin. * * @return bool */ public function can_manage_plugin() { return current_user_can( ABDS_SEO_Activator::CAPABILITY ); } /** * Permission callback for the one route that deactivates another plugin * (POST /migration/deactivate-source). Requires BOTH the plugin's own * management capability AND WordPress's core `activate_plugins` capability. * * Deactivating a plugin is a plugin-management action that WP core always * gates behind `activate_plugins`. The plugin's own `manage_abds_seo` * capability is deliberately also granted to the non-Administrator * "SEO Manager" role (which is NOT allowed to activate or deactivate * plugins), so `manage_abds_seo` alone must never be enough to reach * deactivate_plugins() — this route additionally requires `activate_plugins`. * * @return bool */ public function can_manage_plugin_activation() { return current_user_can( 'activate_plugins' ) && $this->can_manage_plugin(); } }