Custom rules for custom roles
-
I’m looking for a way to add custom role support to your plugin, I can see a bunch of apply_filters hooks in your code that would allow me to add limited viewing capabilities to a custom role but I get stuck on the add_menu_page() call that only allows 2 capabilities to use the plugin at all; view_all_aryo_activity_log and edit_pages. My custom role does NOT allow edit_pages and when I give my role the cap view_all_aryo_activity_log there is no way to use any of the hooks for aal_init_roles and aal_init_caps since the view_all cap allows all to be seen. I suggest a simple addition to the create_admin_menu function;
$menu_capability = apply_filters( ‘aal_view_cap’, current_user_can( ‘view_all_aryo_activity_log’ ) ? ‘view_all_aryo_activity_log’ : ‘edit_pages’ );
This way I can create my own cap to allow a user to see the page at all, and use the other hooks to decide what modules and roles are allowed to be seen.
Regards & compliments, Sander.
- The topic ‘Custom rules for custom roles’ is closed to new replies.