-
Notifications
You must be signed in to change notification settings - Fork 141
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
Entire Code Base: Methods are not checking for valid/existing Roles and Permissions #8
Comments
hmm Notice: This message is digitally signed, its source and integrity are verifiable. On Shahrivar 1, 1392, at 9:27 AM, Jesse Burns notifications@github.com wrote:
|
I was thinking about performance too. I'll also have to think more about this before I can offer what I think is the best solution. One thought off of the top of my head would be to create something similar to $rbac->Reset that will clean the database and remove orphan entries. I see two problems with that:
Like I said, I'll think more on this and try to offer my best opinion/suggestion. |
some of the functionality is used in the administrative interface, and the rest in the common application flow Notice: This message is digitally signed, its source and integrity are verifiable. On Shahrivar 1, 1392, at 1:41 PM, Jesse Burns notifications@github.com wrote:
|
That's a good point. This really is the responsibility of the main application. PhpRbac will never create an orphan on it's own. If there are orphans, it is due to faulty administration code. A helper method to remove orphans might be nice, but I think that's something we can put a hold on until we receive requests for something like that. If you think that it's prudent, we can close this issue. |
Closing issue due to the fact that this topic is outside of PhpRbac's scope. |
It seems that most methods (mainly assignment methods) are not checking to see if we are trying to assign valid/existing Roles and Permissions.
Example:
The only Role/Permission in the database is the 'root' Role and 'root' Permission when we execute this,
After execution the rolepermission table contains this
Result:
Should we be checking for the existence of roles/permissions before trying to manipulate them?
The text was updated successfully, but these errors were encountered: