feat(BA-4785): add connections to RoleGQL with pagination support#9518
Merged
HyeockJinKim merged 7 commits intomainfrom Mar 6, 2026
Merged
feat(BA-4785): add connections to RoleGQL with pagination support#9518HyeockJinKim merged 7 commits intomainfrom
HyeockJinKim merged 7 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a permissions connection field to the RBAC RoleGQL GraphQL type to allow querying permissions associated with a role, including pagination, filtering, and ordering.
Changes:
- Adds a
permissionsfield resolver toRoleGQLthat returns aPermissionConnection. - Scopes permission queries to the current role by injecting a
role_idfilter and merging with user-provided filters. - Introduces
TYPE_CHECKINGimports andstrawberry.lazy()annotations to avoid circular imports.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jopemachine
reviewed
Mar 3, 2026
seedspirit
reviewed
Mar 3, 2026
fc6926d to
461bfb9
Compare
d77b290 to
c367a10
Compare
Base automatically changed from
feature/BA-4873-refactor-search-users-exists-subquery
to
main
March 5, 2026 12:44
461bfb9 to
b358964
Compare
fregataa
added a commit
that referenced
this pull request
Mar 5, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jopemachine
reviewed
Mar 6, 2026
jopemachine
reviewed
Mar 6, 2026
| deleted_at=data.deleted_at, | ||
| ) | ||
|
|
||
| @strawberry.field(description="Permissions associated with this role.") # type: ignore[misc] |
Member
There was a problem hiding this comment.
It seems that "Added in ..." should be included.
Add permissions connection field to RoleGQL for querying associated permissions. ## Changes - Add permissions field to RoleGQL with full Relay pagination support - Use fetch_permissions fetcher for efficient querying - Automatically filter permissions by role_id - Support optional user-provided filters (scope_type, entity_type) - Add TYPE_CHECKING imports for PermissionConnection, PermissionFilter, PermissionOrderBy ## Implementation Details - Field returns PermissionConnection with edges and pageInfo - Uses strawberry.lazy() for cross-entity type references to avoid circular imports - Merges role_id filter with user-provided filters - Supports all standard pagination parameters (before, after, first, last, limit, offset) ## JIRA - BA-4785: Add permissions field with basic resolver to RoleGQL Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: octodog <mu001@lablup.com>
…ction Add RoleGQL.users() field using UserFilterGQL/UserOrderByGQL/UserV2Connection, following the same pattern as ProjectV2GQL.users(). Includes fetch_role_users fetcher function that delegates to search_users_by_role action chain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: octodog <mu001@lablup.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change Role.users field from UserV2Connection to RoleAssignmentConnection to expose assignment metadata (granted_by, granted_at) alongside user data. - Add username, email, granted_by filters to RoleAssignmentFilter - Add username, email sort fields to RoleAssignmentOrderBy - Remove fetch_role_users fetcher (replaced by fetch_role_assignments) - Update GraphQL schema documentation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Change permissions.orderBy from single to list for multiple sort criteria - Add "Added in 26.3.0." version info to permissions and users fields Addresses PR review comments. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
a9c00cf to
af18d49
Compare
HyeockJinKim
approved these changes
Mar 6, 2026
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.
Summary
permissionsandusersconnection fields toRoleGQLfor querying associated dataChanges
permissionsfield toRoleGQL— returnsPermissionConnectionscoped byrole_idusersfield toRoleGQL— returnsUserV2ConnectionviaSearchUsersByRoleActionstrawberry.lazy()for cross-module type references to avoid circular importsGraphQL Query Examples
Permissions field
Users field
Combined query
JIRA Issues
Related
Part of BA-4775 (RBAC GraphQL Type Enhancement)
Test Plan
🤖 Generated with Claude Code
📚 Documentation preview 📚: https://sorna--9518.org.readthedocs.build/en/9518/
📚 Documentation preview 📚: https://sorna-ko--9518.org.readthedocs.build/ko/9518/