Skip to content

Extend Org Admin Authority to Team Management - #493

Open
Dharp02 wants to merge 1 commit into
mainfrom
feat/org-permission-improvements
Open

Extend Org Admin Authority to Team Management#493
Dharp02 wants to merge 1 commit into
mainfrom
feat/org-permission-improvements

Conversation

@Dharp02

@Dharp02 Dharp02 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Overview

Extends org admin authority to cover team management operations. Previously only org owners had elevated team access; org admins are now treated equally, and the code now checks both the modern org_members collection and the legacy owners/admins arrays on the org document.

Changes

meteor-backend/server/org-helpers.js

  • isTeamAdminOrOrgOwner now checks org_members for owner or admin role (not just owner)
  • Falls back to legacy org.owners and org.admins arrays for pre-migration data

meteor-backend/server/permissions.js

  • resolveOrgRoleForTeam gains a legacy fallback: checks org.owners / org.admins arrays when org_members has no matching record
  • buildTeamAbility now grants teamAdminIds to org-elevated users (owner or admin), not just direct team.admins members

meteor-backend/server/teams.js

  • teams.byUser publication (now async) surfaces all non-personal org teams for org owners/admins
  • teams.list method applies the same elevated filter and includes join requests for all org teams the elevated user administers

Acceptance Criteria

  • Org admin can rename, delete, and manage members of any team in their org
  • Org admin sees all org teams in the sidebar (not just teams they explicitly joined)
  • Org admin sees pending join requests for all org teams
  • Legacy orgs (with owners/admins arrays but no org_members records) still grant correct authority
  • Org members without elevated role are unaffected

- isTeamAdminOrOrgOwner now recognizes org admins (not just owners) via org_members
- Add legacy org document admins/owners fallback in resolveOrgRoleForTeam
- teams.byUser publication includes all org teams for owner/admin members
- teams.list method includes org teams and join requests for elevated members
- buildTeamAbility grants team-admin capability to org-elevated users
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

🚀 Preview Deployment Ready

Service URL
App https://mieweb-timehuddle-feat-org-permission-improvements.os.mieweb.org
API (Meteor) https://mieweb-timehuddle-feat-org-permission-improvements-api.os.mieweb.org

Preview auto-deletes when this PR is closed.

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