Closed oknixus closed 1 year ago
@leeqvip
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
.
In the configuration file
lauthz.php
, I change thebasic.model.config_file_path
to__DIR__ . DIRECTORY_SEPARATOR . 'lauthz-rbac-with-domains-model.conf'
, and then copy the fileexample/rbac_with_domains_model.conf
to config directory, and rename the file name toauthz-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 theEnforcer::addRoleForUserInDomain('alice', 'admin', 'article');
.So how to use rbac with domains model ?