Skip to content

Remove the Permissions and Scopes columns from the user permissions users list - #6135

Open
fraxachun wants to merge 1 commit into
claude/user-permissions-content-scope-wildcardfrom
claude/user-permissions-content-scope-summary
Open

Remove the Permissions and Scopes columns from the user permissions users list#6135
fraxachun wants to merge 1 commit into
claude/user-permissions-content-scope-wildcardfrom
claude/user-permissions-content-scope-summary

Conversation

@fraxachun

@fraxachun fraxachun commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Problem

The user permissions users list rendered a "Permissions" and a "Scopes" column for every user. Both required resolving per-user data for every row — a permission count and a per-dimension content scope summary computed through a dedicated request-scoped DataLoader. That added meaningful complexity (an extra service, DTO, and two resolve fields) and per-row cost for information that is already available in more detail on the user's edit page.

Solution

Remove both columns and everything behind them. The users list now shows only the name and email.

  • Remove the permissionsCount and contentScopeSummary fields from UserPermissionsUser.
  • Remove the ContentScopeSummaryByDimension type and the UserContentScopesLoaderService.

Stacked pull request

This is layer 2 of 4 of a stacked pull request. Review and merge bottom-up (each layer targets the one above it):

  1. Support wildcard values for content scope dimensions → main (Support wildcard values for content scope dimensions #6114)
  2. Remove the Permissions and Scopes columns from the user permissions users list (this PR) → Support wildcard values for content scope dimensions #6114 (Remove the Permissions and Scopes columns from the user permissions users list #6135)
  3. Allow declaring content scope dimensions at runtime → Remove the Permissions and Scopes columns from the user permissions users list #6135 (Allow declaring content scope dimensions at runtime #6115)
  4. Rework content scopes management in the user permissions panel → Allow declaring content scope dimensions at runtime #6115 (Rework content scopes management in the user permissions panel #6116)

🤖 Generated with Claude Code

@fraxachun
fraxachun force-pushed the claude/user-permissions-content-scope-summary branch from 9584c44 to 7e76668 Compare August 6, 2026 13:16
@fraxachun
fraxachun force-pushed the claude/user-permissions-content-scope-summary branch from 7e76668 to 7d5042c Compare August 6, 2026 13:46
@fraxachun
fraxachun force-pushed the claude/user-permissions-content-scope-summary branch from 7d5042c to 805e675 Compare August 7, 2026 11:31
@fraxachun
fraxachun force-pushed the claude/user-permissions-content-scope-summary branch 2 times, most recently from 314c233 to e83e517 Compare August 7, 2026 12:19
@fraxachun
fraxachun force-pushed the claude/user-permissions-content-scope-summary branch 4 times, most recently from 25cdb20 to 314c57e Compare August 11, 2026 08:20
@fraxachun
fraxachun requested review from VPS-thodax and nsams and a lite review from Copilot and removed request for nsams August 11, 2026 12:19
@fraxachun
fraxachun requested a review from VPS-Obi August 11, 2026 12:19
@fraxachun
fraxachun marked this pull request as ready for review August 11, 2026 12:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the user-permissions users list to display a per-dimension summary of content scopes (e.g. domain: 3, language: *) instead of a single contentScopesCount, avoiding misleading counts when wildcard ("*") dimension values are present.

Changes:

  • Replaced UserPermissionsUser.contentScopesCount with contentScopeSummary: [ContentScopeSummaryByDimension!]! in the CMS API GraphQL schema and resolvers.
  • Added request-scoped DataLoader logic to compute per-dimension scope summaries efficiently for batched user rows.
  • Updated the CMS admin users grid to render the per-dimension summary text instead of a single “X of Y scopes” chip.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
storybook/.storybook/mocks/handlers.ts Updates Storybook mock schema to reflect contentScopeSummary and the new summary type.
storybook/.storybook/mocks/currentUserHandler.ts Updates mock typing/response shape to provide contentScopeSummary.
packages/api/cms-api/src/user-permissions/user.resolver.ts Switches the GraphQL field resolver from contentScopesCount to contentScopeSummary.
packages/api/cms-api/src/user-permissions/user-permissions.service.ts Exposes filterContentScopesForUser for reuse and removes now-unneeded helper methods.
packages/api/cms-api/src/user-permissions/user-content-scopes.resolver.ts Refactors to use filterContentScopesForUser directly.
packages/api/cms-api/src/user-permissions/user-content-scopes-loader.service.ts Introduces per-dimension summary computation and a DataLoader returning summaries.
packages/api/cms-api/src/user-permissions/user-content-scopes-loader.service.spec.ts Adds tests for summary behavior and batched loading behavior.
packages/api/cms-api/src/user-permissions/dto/content-scope.ts Adds the GraphQL DTO ContentScopeSummaryByDimension.
packages/api/cms-api/schema.gql Updates generated schema to replace contentScopesCount with contentScopeSummary.
packages/admin/cms-admin/src/userPermissions/UserGrid.tsx Renders per-dimension summary strings in the “Scopes” column and simplifies the supporting query.
demo/api/schema.gql Updates demo schema to include the new type/field.
.changeset/user-permissions-content-scope-summary.md Adds a changeset describing the new summary and the field replacement.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .changeset/user-permissions-content-scope-summary.md Outdated
Comment thread packages/api/cms-api/src/user-permissions/user-content-scopes-loader.service.ts Outdated
@fraxachun
fraxachun force-pushed the claude/user-permissions-content-scope-summary branch from 314c57e to 75f5822 Compare August 11, 2026 12:26

@VPS-Obi VPS-Obi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A screenshot would have been nice (added one for you). Tested this locally:

  • The text should still be rendered in a Chip
  • It doesn't work correctly for something like [{ domain: "main", language: "*" }, { domain: "secondary", language: "de" }]. The result is "Domain: 2, Language: *". IMO it should be "Domain: main, Language: *" and "Domain: secondary, Language: en"

Is this better than showing "X out of Y scopes"? Or is this no longer possible since we can't expand "*" dimensions to the actual total count?

@VPS-Obi

VPS-Obi commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Needs human review — permission-related API change, stacked on #6114.

Replaces contentScopesCount with a new contentScopeSummary: [ContentScopeSummaryByDimension!]! field on UserPermissionsUser (breaking GraphQL API change, 13 files changed, +179/-132). Builds directly on the wildcard content-scope logic from #6114, so it should be reviewed together with that PR rather than in isolation.


Generated by Claude Code

@fraxachun
fraxachun force-pushed the claude/user-permissions-content-scope-summary branch from 75f5822 to 496855c Compare August 13, 2026 08:15
@fraxachun
fraxachun force-pushed the claude/user-permissions-content-scope-summary branch from 496855c to 9dc3d14 Compare August 13, 2026 09:23
@fraxachun
fraxachun force-pushed the claude/user-permissions-content-scope-summary branch from 9dc3d14 to f3250ae Compare August 13, 2026 10:23
@fraxachun

fraxachun commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Is this better than showing "X out of Y scopes"? Or is this no longer possible since we can't expand "*" dimensions to the actual total count?

Both solutions don't really work anymore. Can I just remove this field? It never really worked in all circumstances, is a performance killer and the benefit is not very big.

@VPS-Obi

VPS-Obi commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Can I just remove this field?

IMO yes. @VPS-thodax what do you think?

@fraxachun
fraxachun force-pushed the claude/user-permissions-content-scope-summary branch from f3250ae to 82b4ee0 Compare August 13, 2026 12:55
@fraxachun fraxachun changed the title Summarize a user's content scopes per dimension in the users list Remove the Permissions and Scopes columns from the user permissions users list Aug 13, 2026
@fraxachun
fraxachun force-pushed the claude/user-permissions-content-scope-summary branch from 82b4ee0 to cd901d3 Compare August 13, 2026 14:13
@fraxachun
fraxachun force-pushed the claude/user-permissions-content-scope-summary branch from cd901d3 to a4758bf Compare August 13, 2026 14:14
@fraxachun
fraxachun requested a review from VPS-Obi August 13, 2026 14:14
…sers list

Rendering these two columns required resolving each user's permissions and
content scopes per row - permissionsCount, and a per-dimension content scope
summary computed through a dedicated request-scoped DataLoader. Remove the
columns and everything behind them: the UserContentScopesLoaderService, the
permissionsCount and contentScopeSummary resolve fields, and the
ContentScopeSummaryByDimension type. The users list now fetches only name and
email.
@fraxachun
fraxachun force-pushed the claude/user-permissions-content-scope-summary branch from a4758bf to 9463ab7 Compare August 14, 2026 09:29
@nsams
nsams removed their request for review August 18, 2026 06:34
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.

4 participants