Restrict Add Team Member to Super Admins only.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
283ef1ee40
commit
9f658f9cf6
|
|
@ -14,7 +14,7 @@ export function FullPanelOnly({ children, fallback = null }: GateProps) {
|
||||||
return <>{children}</>
|
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) {
|
export function SuperAdminOnly({ children, fallback = null }: GateProps) {
|
||||||
const { canInviteTeam } = useAdminAccess()
|
const { canInviteTeam } = useAdminAccess()
|
||||||
if (!canInviteTeam) return <>{fallback}</>
|
if (!canInviteTeam) return <>{fallback}</>
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ export function isContentManagerRole(role?: string): boolean {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function canSendTeamInvitations(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 {
|
export function isPathAllowedForTeamRole(pathname: string, role?: string): boolean {
|
||||||
|
|
|
||||||
|
|
@ -346,7 +346,7 @@ export function RolesListPage({ embedded = false }: RolesListPageProps) {
|
||||||
{embedded
|
{embedded
|
||||||
? canEditRoles
|
? canEditRoles
|
||||||
? "View and edit system roles and permissions."
|
? "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."}
|
: "Manage roles and their permissions."}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user