• I have a suggestion. Instead of restricting access to the plugin setting pages to the admin role, you should restrict it based on a capability that only an admin has (or perhaps add this as an option in the plugin settings and not force what you think to be the best on those who want to use this plugin).

    I work in an environment where our user login with a centralized authentication system, and they are not assigned roles, but rather capabilities are added based on pre-defined security group on a site-by-site basis. Any plugin restricting based on role does not work for us.

    Luckiy there is an easy way to fix it, but I still feel that role based restriction is not the best approach, as I’m sure I’m not the only one who doesn’t use roles, and I’m sure there are lots of people that do not have direct access to the code to add the simple fix.

    If you don’t agree with this, or just don’t want to make the change, I would at least suggest documenting this for future users, and provide the code to fix it in the plugin readme or on your documentation site.

    For anyone else having this issue, the fix I used is as follows:

    
    function add_redirection_capability_to_user() {
    	return 'manage_options';
    }
    add_filter( 'redirection_role', 'add_redirection_capability_to_user' );
    
    • This topic was modified 7 years, 3 months ago by Troy Chaplin.
    • This topic was modified 7 years, 3 months ago by Troy Chaplin.
  • The topic ‘User capabilities’ is closed to new replies.