Can permission have two or more rules?

I have "article" that can have "locked" and "unlocked" state.

Admins should be able to edit all Aritcles (locked and unlocked) and users should be able to edit only their own and unlocked articles.

Right now i have IsOwner rule which i attached to "Edit Own" permission. Can i create new rule and add it to that same permission?


So how do you go around it?

Right now i have this sorted in way that i created additional permission "EditOwnIsLocked" to which i attached "IsLocked" rule.

Basicly whole setup right now looks like this:

Edit(permission)->EditOwn(permission)+IsOwner(rule)->EditOwnIsLocked(permission)+IsLocked(rule). It’s working fine, but it does feel very dirty and it spawns new permission for any new permission that i will create (like Delete permission that will have DeleteOwn etc.).

Either use it the way you’re using it or adjust your rule to include all conditions you need.

Thank you. As i don’t fancy writing same code many times again and again ill do it way i do it now, which keeps code for checking “lock” status in one place, code for “owner” on other etc and i can combine em trough administration (yii2 admin extension). I hope that in future, there will be option to use multiple rules on permissions.