Skip to content
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

Correct countAll to countAllResults #133

Merged
merged 1 commit into from
Nov 6, 2019

Conversation

MGatner
Copy link
Collaborator

@MGatner MGatner commented Nov 6, 2019

countAll() now returns all result regardless of where(), etc, filters causing PermissionModel to approve any request as long as there are permissions. How that for generous!

This PR adjusts PermissionModel to use countAllResults() instead, which will respect the WHERE clause.

@MGatner
Copy link
Collaborator Author

MGatner commented Nov 6, 2019

This fixes #131

@lonnieezell
Copy link
Owner

Great. Thanks.

A deeper issue that I need to fix - looks like user permissions have 2 places they could be stored - either json_encoded in the user table (which is where they currently are, I believe) or in the auth_users_permissions table, which is probably more correct. I can see doing it on the user table a little simpler for the Entity, which might be why we were storing it there, but seems like it might cause other complexities. Any thoughts on that?

@lonnieezell lonnieezell merged commit e1624e6 into lonnieezell:develop Nov 6, 2019
@MGatner MGatner deleted the count-results branch November 6, 2019 19:48
@MGatner
Copy link
Collaborator Author

MGatner commented Nov 6, 2019

I'm generally not a fan of nested data for relational databases. With our robust Entity class these days it is pretty easy to handle this seamlessly and if developers want to get into more complex relation loaded it leaves that open for them. So I guess I'm in favor of the separate table implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants