how to use rbac with domains model?
oknixus opened this issue · 4 comments
In the configuration file lauthz.php, I change the basic.model.config_file_path to __DIR__ . DIRECTORY_SEPARATOR . 'lauthz-rbac-with-domains-model.conf', and then copy the file example/rbac_with_domains_model.conf to config directory, and rename the file name to authz-rbac-with-domains-model.conf.
But the next step is ?
I got the error grouping policy elements do not meet role definition when I use the Enforcer::addRoleForUserInDomain('alice', 'admin', 'article');.
So how to use rbac with domains model ?
I did what you said, and everything is as expected, and there is an extra policy in the database.
1 g alice admin article 2023-03-19 15:35:56 2023-03-19 15:35:56
Did not encounter the problem you mentioned. Can you insist that the content of your conf file is correct and effective (restart the service)?
@oknixus Is there any historical data left over from other models in your database? An error will occur if there is data loaded that does not conform to the current model.
Yes, u r right.
I think my problem was caused by my old rules.
The old rules was lauthz-rbac-model.conf.