Closed cloudswitch closed 9 years ago
The module uses the default Yii2 AccessControl
action filter to check permissions. The AccessRule
functionality assumes that there is an AuthenticationManager configured. If the yii2-user module does not support RBAC in the way the framework expects, I'm afraid that at this point you'll have to disable the checking for a role. Perhaps we can add some kind of a callback function functionality so that you can implement the access check yourself?
oooookay, so basically I don't want to use roles, only rules. sorry I know it's not your task to make it clear for me, but if you can help me how can I disable checking for roles, I would be grateful. Meanwhile I'm also searching for a soultion, but as I'm beginner, for me it's very hard.
I'm trying to figure out what or why. I was just saying that the module was written expecting default yii behavior (and requires an authManager if you want to use roles). I don't know if the yii2-user module changes anything there.
You can configure the module to not check roles by adding 'accessRoles' => null
to its configuration. Please beware that this opens up the auditing for everyone, unless you also add 'accessUsers' => array(userIds)
to limit it to specific users. Please refer to the Auditing.php
file for the configuration options.
Thanks a lot! It works now! Super! You are a pro! are you willing to teach me? :) I'm trying to use this one:
'components' => [
'authManager' => [
'class' => 'yii\rbac\DbManager',
],
but as I mentioned, I'm trying to use only rules at the moment (and I don't know yet how it can be implemented)
Did you read http://www.yiiframework.com/doc-2.0/guide-security-authorization.html ? This is some basic information about the Yii2 basic roles and rules. Especially in the RBAC section. Good luck!
I've also updated the README to reflect the fact that the user should have RBAC active to use checking on roles. Closing this issue as it is not a real problem.
when trying to access ?r=auditing/default/trail
I'm using yii2-user. Can it be the problem? Thanks!