Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My answer might not shed much of a new light on the problem:</p> <p>Eventually, the application cannot guess who is allowed to do each operation. You'll have to tell Yii who is allowed to do what action - this way (which might be longer) or the other way (which may be shorter).</p> <p>You can do this in the 'long way', which is adding a 'checkAccess()' in the beginning of each action method, and reacting with a custom message if the user does not have the access. Note that this way, even if long, is verbose and clean, which leads to easier maintenance of the code.</p> <p>You can also utilize, as you point out, 'access control filter' with a '<a href="http://www.yiiframework.com/doc/guide/1.1/en/topics.auth#access-control-filter" rel="nofollow">accessRules</a>' method. That's shorter, but less clear to an outsider (which can be you, after a few months away from that mental area of the code), hence the code is less maintainable, IMHO.</p> <p>I do want to point out that using the 'access control filter' with RBAC does NOT contradict or undermines a very nice permission's hierarchy. Remember that this hierarchy comprises of roles that inherit from each other, and each role comprising tasks and possibly operations (YMMV. I typically do roles that inherit from each other, and each role is "comprised" of tasks, some of which have bizrules). If you can elaborate more why do you think this will "defeat the purpose of having a role>task>operation hierarchy" that can be fruitful for this discussion.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload