Skip to content

Give staff users and global group members administrator access to every org - #271

Merged
norkans7 merged 1 commit into
mainfrom
global-org-access
Sep 14, 2026
Merged

norkans7 merged 1 commit into
mainfrom
global-org-access

Conversation

@norkans7

@norkans7 norkans7 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Users with is_staff set, or who belong to the group named by the new SITE_GLOBAL_GROUP setting ("Global" by default), are now treated as administrators of every org.

  • New has_global_access(user) helper, also available as User.has_global_access(), cached on the user object
  • get_user_orgs() returns every active org for those users, so the org chooser lists them all
  • Org.get_user_org_group() resolves to the Administrators group for those users before checking the org's own admin/editor/viewer roles, so a lesser role on an org doesn't limit them

No view changes needed: OrgPermsMixin, OrgObjPermsMixin, the chooser and the org_perms context processor all go through these functions. Superuser-only views (org list, users, etc.) are unaffected.

Tests cover the helper, get_user_orgs, org group resolution, and the chooser / org home / edit / manage accounts views for both a staff user and a global group member. A Global group is added to the test runner settings.

…ry org

Users with is_staff set, or who belong to the group named by the new
SITE_GLOBAL_GROUP setting ("Global" by default), now see every active org
in the chooser and are treated as administrators on any org site, even
where they hold no role or a lesser one. Superuser-only views are
unaffected.

Claude-Session: https://claude.ai/code/session_01DUv4DmGrs25c9TwhzqmH81
@norkans7
norkans7 merged commit ea24a41 into main Sep 14, 2026
16 checks passed
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.

1 participant