Restrict Add Team Member to Super Admins only.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Yared Yemane 2026-08-08 12:00:48 +03:00
parent 283ef1ee40
commit 9f658f9cf6
3 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ export function FullPanelOnly({ children, fallback = null }: GateProps) {
return <>{children}</>
}
/** Renders children only for Admin / Super Admin (e.g. team email invites). */
/** Renders children only for Super Admin (e.g. team email invites). */
export function SuperAdminOnly({ children, fallback = null }: GateProps) {
const { canInviteTeam } = useAdminAccess()
if (!canInviteTeam) return <>{fallback}</>

View File

@ -29,7 +29,7 @@ export function isContentManagerRole(role?: string): boolean {
}
export function canSendTeamInvitations(role?: string): boolean {
return FULL_PANEL_TEAM_ROLES.has(normalizedTeamRole(role))
return normalizedTeamRole(role) === "SUPER_ADMIN"
}
export function isPathAllowedForTeamRole(pathname: string, role?: string): boolean {

View File

@ -346,7 +346,7 @@ export function RolesListPage({ embedded = false }: RolesListPageProps) {
{embedded
? canEditRoles
? "View and edit system roles and permissions."
: "View system roles and permissions. Only Admins can make changes."
: "View system roles and permissions. Only Super Admins can make changes."
: "Manage roles and their permissions."}
</p>
</div>