-
Notifications
You must be signed in to change notification settings - Fork 45
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
Policy add command incorrectly inserts policy resulting in error #55
Comments
@timyourivh hi, can you make a PR to fix it? |
@timyourivh The fourth parameter of this command is the policy string, separated by commas(,). I followed your steps, but it didn't reproduce in my console. Which terminal do you use, is it a character problem? |
@leeqvip That appears to be it! I was already wondering what could be the issue since I couldn't find any issues or bug in the code responsible :p |
Note:The docs state that
|
Package version used:
casbin/laravel-authz: ^3.1
(v3.1.4 in lockfile)When trying out this package I tried adding a policy using the
policy:add
command. As stated in the documentation found in the README.md:README.md snippet
I ran command
php artisan policy:add admin,posts,index
. This resulted in the following record being inserted:Which I assumed was incorrect.
It also throws an error when comparing/checking the rule:
I manually changed the rule to the way the Enforcer facade adds it:
Which worked. So I think this is a bug.
Sidenote:
The command
policy:add
implies that it adds a policy whileEnforcer::addPermissionForUser()
(which does the same) implies that it adds a permission which is inconsistent. I suggest renaming one of the two to match the other.The text was updated successfully, but these errors were encountered: