[Bb-trac] Re: [bbPress] #702: New bb_role should be able to extend existing role

bbPress bb-trac at lists.bbpress.org
Fri Sep 14 23:46:26 GMT 2007


#702: New bb_role should be able to extend existing role
-------------------------+--------------------------------------------------
 Reporter:  fel64        |        Owner:     
     Type:  enhancement  |       Status:  new
 Priority:  normal       |    Milestone:     
Component:  Back-end     |      Version:     
 Severity:  normal       |   Resolution:     
 Keywords:               |  
-------------------------+--------------------------------------------------
Comment (by mdawaffe):

 You can do this on a per user basis (which is what it sounds like you want
 anyway).

 {{{
 $bob = new BB_User(2); // 2 is the ID of the pre-existing user

 $bob->set_role( 'member' );  // Make sure bob's role is member
 $bob->add_cap( 'move_topics' ); // Give bob some additional caps
 $bob->add_cap( 'stick_topics' );
 }}}

 You can even give a user multiple roles.  That user will have all of the
 caps in those roles.

 {{{
 $bob->set_role( 'member' );
 $bob->add_role( 'my-custom-role' );
 }}}

 Each of those examples would only need to be done once for each user (not
 every page load).

 Is that enough?

-- 
Ticket URL: <http://trac.bbpress.org/ticket/702#comment:1>
bbPress <http://bbpress.org/>
Innovative forum development


More information about the Bb-trac mailing list