Skip to content

Conversation

@Knerio
Copy link
Member

@Knerio Knerio commented Nov 22, 2025

close #695

@github-actions
Copy link

github-actions bot commented Nov 22, 2025

GitLab Pipeline Action

General information

Link to pipeline: https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2173849160

Status: Passed
Duration: 4 minutes

Job summaries

rspec: [ee]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12183900756/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2173849160/test_report
Finished in 21.82 seconds (files took 9.5 seconds to load)
1218 examples, 0 failures
Line Coverage: 91.34% (4125 / 4516)
[TEST PROF INFO] Time spent in factories: 00:12.072 (44.51% of total time)

rspec: [ce]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12183900755/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2173849160/test_report
Finished in 18.82 seconds (files took 14.6 seconds to load)
1171 examples, 0 failures
Line Coverage: 90.74% (3957 / 4361)
[TEST PROF INFO] Time spent in factories: 00:10.613 (42.8% of total time)

rubocop

683 files inspected, no offenses detected

Copilot finished reviewing on behalf of Knerio November 22, 2025 20:46
Copy link
Contributor

Copilot AI left a comment

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 enables admin users to query all organizations in the system, addressing issue #695. Previously, users could only see organizations where they were members.

  • Adds a global admin condition to BasePolicy to identify system administrators
  • Modifies the organizations GraphQL query to return all organizations for admin users
  • Updates NamespacePolicy to grant admins full namespace access rights
  • Renames admin to namespace_admin in CustomizablePermission to distinguish between global and namespace-level admin roles

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
app/graphql/types/query_type.rb Returns all organizations for admin users instead of filtering by membership
app/policies/base_policy.rb Adds global admin condition to check if a user is a system administrator
app/policies/namespace_policy.rb Grants admin users namespace_administrator and has_access permissions on all namespaces
app/policies/concerns/customizable_permission.rb Renames admin condition to namespace_admin to avoid naming conflict with global admin condition
spec/requests/graphql/query/organizations_query_spec.rb Adds test coverage for admin users querying all organizations; includes minor formatting adjustments to existing test

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Knerio Knerio force-pushed the 695-adjust-queryorganizations-to-return-all-organizations-visible-to-the-current-user branch from 2e77e07 to 914de5b Compare November 22, 2025 21:20
@Taucher2003 Taucher2003 merged commit 61155dc into main Nov 23, 2025
1 check passed
@Taucher2003 Taucher2003 deleted the 695-adjust-queryorganizations-to-return-all-organizations-visible-to-the-current-user branch November 23, 2025 14:40
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.

Adjust Query.organizations to return all organizations visible to the current user

3 participants