2

I installed several plugins(buddypress-docs,achievement,bbpress), each one create capabilities for their own post_type. I would prefer to make all roles and capabilities unified into one system, Is there a solution to overwrite all existing caps and control all post_types? Eventually I would like to organize users by group, and assign each user group different caps across all types.

2
  • 2
    Some examples would be very helpful. Be specific! :)
    – fuxia
    Commented Oct 27, 2012 at 2:12
  • just added the plugin names
    – Jenny
    Commented Oct 27, 2012 at 7:08

2 Answers 2

0

Try the Members Plugin. This will allow you to create a new roles (which you can then assign to the groups) with their own cap or mixture thereof.

3
  • for example, in the CPT templates, it normally has conditional tags such as if(bp_docs_user_can($cap)), then, display the content. So, after I use Members or Role-scope, how the CPT templates cope up ?
    – Jenny
    Commented Oct 27, 2012 at 8:39
  • 2
    justintadlock.com/archives/2010/07/10/… and justintadlock.com/archives/2012/10/16/… should point you in the right direction.
    – Brooke.
    Commented Oct 27, 2012 at 9:08
  • just finished reading the 2 articles,great resource! I tried Members before, it seems to me it doesn't handle the situation where I want to allow certain users to have the cap to edit posts under a category.
    – Jenny
    Commented Oct 27, 2012 at 9:54
0

Members plugin will do exactly what you're looking for. I use it in conjuntion with manually adding caps:

// Manipulating a role's capabilities -> http://codex.wordpress.org/Roles_and_Capabilities#edit_posts
function manipulate_role(){
   $role = get_role( 'Master Editor' ); // pick up role to edit

   $role->add_cap( 'edit_users' );
   $role->remove_cap( 'update_core' );         
}
add_action( 'admin_init', 'manipulate_role');

Maybe it's just me but I found that mapping your own cpt's is the worst idea ever...

Download Map Cap for that instead of coding your "maps". WP has a ways to go with roles and caps and you'll never be able to write code that works as good or better than what Map Cap can accomplish with a few checkboxes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.