• I would like the ‘editors’ or a custom defined role on my site to have access to some plugins at the admin backend. For eg, polls, faq-tastic, event-calendar, dmsguestbook, wp-dir-pro etc so that the management work can be distributed.

    How can this be done?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I use a number of systems, and WP is weak in this area. There are some nice plugins that will allow you to set granular permissions, but these generally will have no affect on plugins. For that, you’re at the mercy of the plugin developer, and more often than not, they only code the plugin for full Admins, as it’s extra work to allow for other roles. If you’re a good PHP coder, you may be able to mod the plugin yourself to do this – I have not done it myself.

    Sorry not to have an easy answer for you. It’s a beef of mine. I tend to warn clients that if they want so-and-so plugin, the client updating it must be a full admin, which is obviously somewhat risky if this person is careless or inept.

    Thread Starter doctorb

    (@doctorb)

    Thanks for the input. Yes, the permission system is really very deficient in WordPress. I better start looking at the code of the plugins!

    Thread Starter doctorb

    (@doctorb)

    The first plugin Faq-tastic, checks the highest user role and gives it access :

    function has_access ()
    	{
    		$options = $this->get_options ();
    
    		global $wp_roles;
    		$caps = $wp_roles->get_role ($options['access_level']);
    
    		// Get highest level of the role
    		for ($x = 10; $x >= 0; $x--)
    		{
    			if (isset ($caps->capabilities['level_'.$x]))
    				break;
    		}
    
    		global $current_user;
    
    		// Can this user access that level
    		if (isset ($current_user->allcaps['level_'.$x]))
    			return true;
    		return false;
    	}

    Can anybody help me modify this so that the function returns true not for highest level but for a level higher than, say 5 (for editors)

    LJagermaster

    (@the-living-legend)

    I’m as far away as you can get from an expert but by looking at the code you posted it would seem feasible that if you change the number 10 (which is by default the highest access level in wp) to a 5, you should achieve what you’ve asked. However it goes without saying to tread very carefully when allowing others to mess about with the settings of a plugin – if one of them gets a sudden burst of “creativity” they may be tempted to change them in a way you’re not happy with.

    Hope this helps.

    LJ

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add capabilty to acces some plugins for some roles’ is closed to new replies.