-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
array_combine error with different request and policy definitions #78
Comments
Hello @leeqvip, |
@swarakaka This is probably not a problem with php-casbin itself. |
Yes, all the policies are successfully returning. even for the user.
|
Some policies have 6 columns, but your model configuration only has 5 parameters |
@leeqvip
controller model:
|
@swarakaka So you need to modify your model or delete the policies that do not comply |
@leeqvip |
@swarakaka If you have multiple enforcers, different enforcers should use different adapters or data tables. |
Thank you very much for your reply. That's a good way. I found another solution, which compares all polices by roles:
|
Do you want to determine the role inheritance relationship? You can try |
No. Because I’ve already got the roles. As I described the problem above. I can't do my comparison with Enforcer::enforce(), hence I do my comparison with cops. |
If you want to decide whether a role has direct permissions, you can modify the expression configured in the model. |
@leeqvip |
Hello everyone!
I'm implementing role-based access control in my Laravel application using php-casbin/laravel-authz. I'm encountering an error when trying to enforce policies using a custom model where request and policy definitions have different numbers of parameters.
My model configuration:
The error I'm getting is:
array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements
This occurs in CoreEnforcer.php:761 when calling enforce(). I'm using a guarded enforcer like this:
This is a practical working example.
related issue #127
The text was updated successfully, but these errors were encountered: