I have implemented a RBAC functionality and everything is working fine. The thing is, I want to add an additional condition to the access control. For example, I want the user to be role ‘admin’ and have a status of ‘active’ in order to access an action.
You can create a method on your user model to return the value of active status, then call it in an access control rule on the controller in matchCallback, something like:
The PermissionHelpers class and requireStatus method used there is something I wrote as part of a helper class for this purpose, but that is specific to my project. But you could write a method that compares the current users status value to the value of active, along the same lines. If it returns true, it matches the callback and the action is allowed to continue. This way you do not have to affect your other RBAC. Hope this helps.