feat: Add user relations loading methods for groups and permissions#1257
Merged
michalsn merged 2 commits intocodeigniter4:developfrom Jul 6, 2025
Merged
feat: Add user relations loading methods for groups and permissions#1257michalsn merged 2 commits intocodeigniter4:developfrom
michalsn merged 2 commits intocodeigniter4:developfrom
Conversation
datamweb
approved these changes
Mar 1, 2025
Collaborator
datamweb
left a comment
There was a problem hiding this comment.
LGTM! Thanks.
@dgvirtual Please confirm if the issue has been resolved.
665af54 to
5272cc2
Compare
Member
Author
|
Thanks @datamweb |
Contributor
|
I added in Bonfire2 src\Users\Controllers\UserController: The withGroups part works (-14 database calls). The withPermissions part seems to not work: I still get lazy loading on calling |
Member
Author
|
I guess this may occur when no permissions are set for the user. I will look into it tonight. |
Contributor
|
Yep, could be, I will check that as well
…On Sun, 5 Oct 2025, 17:01 Michal Sniatala, ***@***.***> wrote:
*michalsn* left a comment (codeigniter4/shield#1257)
<#1257 (comment)>
I guess this may occur when no permissions are set for the user. I will
look into it tonight.
—
Reply to this email directly, view it on GitHub
<#1257 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAULV6QI6VYWRDV65KFEB333WEQCPAVCNFSM6AAAAABYBVKXG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNRZGA3TQOBSGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Member
Author
|
@dgvirtual Please check #1290 when you get a chance. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR enhances user queries by enabling the retrieval of related user data more efficiently.
It adds two new methods:
withGroups()andwithPermissions(), which loads user groups and permissions directly when fetching users. The existingwithIdentities()method (previously undocumented) has also been included in the documentation.With these methods, all necessary user information can be loaded in a single query (one per used method), reducing the number of additional queries and improving performance.
The problem this PR solves was described in the Bonfire2 repo: lonnieezell/Bonfire2#558
Checklist: