Yii Framework Forum: Rbac (Ch7 Pg178) Allows Just One Role-User Association... - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Rbac (Ch7 Pg178) Allows Just One Role-User Association... So you can't be, say, the 'owner' of more than one project

#1 User is offline   RolandoEfren 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 07-January 13

Posted 30 October 2013 - 09:25 PM

$auth->assign($this->role, $this->_user->id, $bizrule);

Can only by executed a single time for every role and user combination or you'll get a database exception. That means that you cannot have the same role in more that one project.

Do I am missing something?

Thanks a lot for any comments.
0

#2 User is offline   RolandoEfren 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 07-January 13

Posted 02 November 2013 - 12:03 PM

The author's solution was posted in: www.seesawlabs.com/yii-book/corrections

The real check is made in the tbl_project_user_assignment through the $bizrule, the tbl_auth_assignment checking is just so we can use Yii's RBAC implementation.

Having the two tables makes the checking something like:

"Are you an owner? and if so, are you an owner of this specific project?"

The second question would suffice.

Maybe I'll try to revise that implementation later.

Thanks for your time
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users