CAccessControl with User Privilages

Hello, I want to combine CAccessControl and user privilages, so here is what I have now:

  1. I have edited UserIdentity and so after user loges in I setState(‘privilages’, $record->privilages). ‘privilages’ may equal to 0,1,2,3,4…

  2. I want to create something like this: user is allowed to make this action if ‘privilages’ > 2

I have read the manual about CAccessControl but I can’t guess how to set rules of CAccessControl to acheave my goal.


Sorry for my English.

Take a look into CAccessRule class first. You might overwrite it and to add you custom rule. I did so for my application (but I needed something different from your task). Or take a look at expression property, it seems to be useful for you.