SCIM: fix the member types for /Roles#2051
Merged
paulfitz merged 1 commit intogristlabs:mainfrom Jan 21, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes an issue where Role members in the SCIM API were being reported with incorrect types. When querying /api/scim/v2/Roles, Role members that were other Roles were being reported as type "Group" instead of type "Role".
Changes:
- Updated the Role schema to accept "Role" as a valid member reference type and canonical value
- Modified the member serialization logic to correctly distinguish between Group-type and Role-type members
- Added comprehensive tests to verify Roles can contain User, Group, and Role members with correct types
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/server/lib/scim/v2/ScimUtils.ts | Added SCIMMY_ROLE_TYPE constant and updated toSCIMMYMembers to filter and serialize Role-type members with correct type and reference paths |
| app/server/lib/scim/v2/roles/SCIMMYRoleSchema.ts | Updated Role schema definition to support Role members, with "Role" added to referenceTypes and canonicalValues, and improved description |
| test/server/lib/Scim.ts | Added test verifying that Roles can contain Group and Role members, with correct type identification and reference URIs in API responses |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
24eda39 to
8e39f82
Compare
paulfitz
reviewed
Jan 15, 2026
8e39f82 to
91e97c2
Compare
Also the schema of the Role's "members" attribute had to be updated, as it accepts members that are Users, Groups but also other Roles. Roles can contain other Roles members with the inheritance, for example when a doc inherits of all the roles from its workspace: then the owners Role of the doc contains the "owners" Role of the workspace.
91e97c2 to
8e70514
Compare
Collaborator
Author
|
The error looks related to this fix: |
paulfitz
approved these changes
Jan 21, 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.
Context
Quoting #1989:
When querying the
GET /api/scim/v2/Rolesendpoint, we see members of the Roles.When a role is inherited (for example the roles of a doc inside a workspace), we expect the members of the Role of the document to include Roles of the workspace.
But we see Groups. For example:
{ "schemas": [ "urn:ietf:params:scim:schemas:Grist:1.0:Role" ], "id": "2300", "meta": { "resourceType": "Role", "location": "/api/scim/v2/Roles/2300" }, "displayName": "viewers", "members": [ { "value": "336", "display": "viewers", "$ref": "/api/scim/v2/Groups/336", "type": "Group" } ], }Proposed solution
Also the schema of the Role's "members" attribute had to be updated, as it accepts members that are Users, Groups but also other Roles.
Roles can contain other Roles members with the inheritance, for example when a doc inherits of all the roles from its workspace: then the owners Role of the doc contains the "owners" Role of the workspace.
Related issues
Fixes #1989
Has this been tested?