Skip to content

feat(CentralIdentity): add campus admin roles mgmt to user view#736

Merged
jakeaturner merged 1 commit intomasterfrom
staging
Mar 18, 2026
Merged

feat(CentralIdentity): add campus admin roles mgmt to user view#736
jakeaturner merged 1 commit intomasterfrom
staging

Conversation

@jakeaturner
Copy link
Collaborator

No description provided.

@jakeaturner jakeaturner requested a review from Copilot March 18, 2026 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

Adds campus admin role management to the Central Identity user detail view, and standardizes organization ordering coming from the backend.

Changes:

  • Sort /orgs results by name server-side.
  • Add CampusAdminRolesSection and render it in CentralIdentityUserView.
  • Add new client API helpers for user roles + organizations, and remove the legacy roles modal.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
server/api/organizations.ts Adds a $sort stage so organizations are returned alphabetically.
client/src/screens/conductor/controlpanel/CentralIdentity/CentralIdentityUserView.tsx Adds campus admin roles section and refines loading/layout behavior in the user view.
client/src/components/controlpanel/CentralIdentity/CampusAdminRolesSection.tsx New UI to list/grant/revoke campus admin roles via React Query + API calls.
client/src/api.ts Adds getUserRoles, updateUserRole, and getAllOrganizations API methods.
client/src/components/controlpanel/UsersManager/ManageUserRolesModal.tsx Removes legacy modal implementation.
client/src/components/controlpanel/CentralIdentity/UserSupportTickets.tsx Minor layout spacing adjustment.
client/src/components/controlpanel/CentralIdentity/UserConductorData.tsx Minor layout spacing adjustment.

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

You can also share your feedback on Copilot code review. Take the survey.

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

Adds campus-admin role management to the CentralIdentity user detail view, aligning server-side role update permissions with LibreTexts superadmin-only access and improving org listing order.

Changes:

  • Add a new CentralIdentity “Campus Admin Roles” section (grant/revoke per organization) in the user view and introduce supporting client API methods.
  • Restrict role update/delete endpoints to libretexts superadmin and disallow assigning superadmin via the standard role update endpoint.
  • Sort /orgs results by organization name at the API level and remove the legacy roles-management modal.

Reviewed changes

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

Show a summary per file
File Description
server/api/users.js Tightens role assignment rules (blocks superadmin assignment; blocks campusadmin for libretexts).
server/api/organizations.ts Adds server-side $sort by name for /orgs results.
server/api.js Updates middleware so role update/delete endpoints require libretexts superadmin.
client/src/screens/conductor/controlpanel/CentralIdentity/CentralIdentityUserView.tsx Adds CampusAdminRolesSection to the user view; refines loading states/UI.
client/src/components/controlpanel/CentralIdentity/CampusAdminRolesSection.tsx New UI for viewing/granting/removing campusadmin roles using React Query + new API methods.
client/src/components/controlpanel/UsersManager/ManageUserRolesModal.tsx Removes legacy modal implementation.
client/src/components/controlpanel/CentralIdentity/UserSupportTickets.tsx Minor layout adjustment (removes bottom margin).
client/src/components/controlpanel/CentralIdentity/UserConductorData.tsx Minor layout adjustment (adds top margin).
client/src/api.ts Adds typed wrappers for /user/roles, /user/role/update, and /orgs.

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

You can also share your feedback on Copilot code review. Take the survey.

@jakeaturner jakeaturner merged commit b70d557 into master Mar 18, 2026
7 checks passed
@libretexts-bot
Copy link
Collaborator

🎉 This PR is included in version 2.122.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants