[wp-hackers] current_user_can() and roles ?

Stephen Rider wp-hackers at striderweb.com
Wed Jan 6 20:14:27 UTC 2010


On Jan 6, 2010, at 1:33 PM, Frank Bueltge wrote:

> The admin give other users a rolle, not rights and in my plugin it os:
> the admin select the role and i will check only for this. Maybe i must
> add a new capabilitie to the role, the select the admin. And then i
> can check for the new object. A also then it is possiblt to add this
> object to a new role "superman".

Generally I have found that an existing capability is "close enough" to the ability I want to add.  If your plugin is doing something truly unique, though, you may think about actually adding a new capability.

If you do that, don't forget to assign that Capability to one or more Roles so somebody can actually do the thing!  ;-)

(I'm actually going to have to do this soon with a plugin that I don't even want *admins* to have direct access to.  I believe I'm going to end up creating a new capability and new "super admin" role....)

Regards,

Stephen



More information about the wp-hackers mailing list