-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Possible issue involving permissions of models with composite name #72
Comments
I was able to do a dirty fix just removing the Let me know if a PR using this approach is welcome and I can create one (deniscsz@0c8a72b). |
@coolsam726 I created a PR, take a look if you have interest to use it: #74. My fix is different of your, I kept the permissions as generated, like projectcategory. I just change some pieces of the shield's form to make it matches. Check all works too in this case. |
@bezhanSalleh Ok, thanks for let me know. |
@bezhanSalleh, thanks for responding to this. Could we leave the issue open until PR #69 is merged then? Or is the fix already released? |
i will definitely review it once more. But bear in mind it's not just the composite resource names but also how resources are structured... i.e. in the demo there is Blog and Shop and they both have CategoryResource... so the draft PR also takes care of that situation as well during policy and permission generation... @coolsam726 no need it's almost done... will be out in a day or two 😇 |
I'm facing an issue involving a mismatch with the name of permissions for models with composite name.
My model is named as
IpAddress
. After ran install command the permissions were created in the database as:Also in the
IpAddressPolicy
class, the permissions are exactly the same and it is working for super admin at this point.The problem starts after create a new role with low access and try add permissions for this resource. When we need change the role, the form of the card in edit page has the wrong name in the fields.
After enable the toogle and save it, I'm able to see permissions duplicated in the database (table
permissions
): there are two records for each permission, one withipaddress
and other withip_address
. The permissions in DB are like this list:After this point all the users (even super_admin) are not able to access the resource, no matter what you try in the settings or in role configuration.
The others resource for Models with regular names, like the model Banner from the screenshot, are still working perfectly.
The text was updated successfully, but these errors were encountered: