Move role management into Settings Security with Super Admin edit access.
Embed roles under Settings, remove the sidebar Roles entry, and limit role edits to Super Admins. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
4f0190f301
commit
776f7a2872
|
|
@ -49,9 +49,6 @@ import { UserManagementLayout } from "../pages/user-management/UserManagementLay
|
||||||
import { UsersListPage } from "../pages/user-management/UsersListPage";
|
import { UsersListPage } from "../pages/user-management/UsersListPage";
|
||||||
import { UserGroupsPage } from "../pages/user-management/UserGroupsPage";
|
import { UserGroupsPage } from "../pages/user-management/UserGroupsPage";
|
||||||
import { DeletionRequestsPage } from "../pages/user-management/DeletionRequestsPage";
|
import { DeletionRequestsPage } from "../pages/user-management/DeletionRequestsPage";
|
||||||
import { RoleManagementLayout } from "../pages/role-management/RoleManagementLayout";
|
|
||||||
import { RolesListPage } from "../pages/role-management/RolesListPage";
|
|
||||||
import { AddRolePage } from "../pages/role-management/AddRolePage";
|
|
||||||
import { PracticeDetailsPage } from "../pages/content-management/PracticeDetailsPage";
|
import { PracticeDetailsPage } from "../pages/content-management/PracticeDetailsPage";
|
||||||
import { PracticeMembersPage } from "../pages/content-management/PracticeMembersPage";
|
import { PracticeMembersPage } from "../pages/content-management/PracticeMembersPage";
|
||||||
import { QuestionsPage } from "../pages/content-management/QuestionsPage";
|
import { QuestionsPage } from "../pages/content-management/QuestionsPage";
|
||||||
|
|
@ -103,10 +100,8 @@ export function AppRoutes() {
|
||||||
<Route path=":id" element={<UserDetailPage />} />
|
<Route path=":id" element={<UserDetailPage />} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
<Route path="/roles" element={<RoleManagementLayout />}>
|
<Route path="/roles" element={<Navigate to="/settings?tab=security" replace />} />
|
||||||
<Route index element={<RolesListPage />} />
|
<Route path="/roles/*" element={<Navigate to="/settings?tab=security" replace />} />
|
||||||
<Route path="add" element={<AddRolePage />} />
|
|
||||||
</Route>
|
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
<Route path="/content" element={<ContentManagementLayout />}>
|
<Route path="/content" element={<ContentManagementLayout />}>
|
||||||
|
|
|
||||||
|
|
@ -63,11 +63,10 @@ const navEntries: NavEntry[] = [
|
||||||
kind: "group",
|
kind: "group",
|
||||||
label: "Users & access",
|
label: "Users & access",
|
||||||
basePath: "/users",
|
basePath: "/users",
|
||||||
activePaths: ["/users", "/roles", "/team"],
|
activePaths: ["/users", "/team"],
|
||||||
icon: Users,
|
icon: Users,
|
||||||
children: [
|
children: [
|
||||||
{ label: "All users", to: "/users/list" },
|
{ label: "All users", to: "/users/list" },
|
||||||
{ label: "Roles", to: "/roles" },
|
|
||||||
{ label: "Team members", to: "/team" },
|
{ label: "Team members", to: "/team" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ import { AppVersionsTab } from "./settings/AppVersionsTab";
|
||||||
import { SubscriptionPlansTab } from "./settings/SubscriptionPlansTab";
|
import { SubscriptionPlansTab } from "./settings/SubscriptionPlansTab";
|
||||||
import { ThemeModePreview } from "./settings/components/ThemeModePreview";
|
import { ThemeModePreview } from "./settings/components/ThemeModePreview";
|
||||||
import { useTheme } from "../contexts/ThemeContext";
|
import { useTheme } from "../contexts/ThemeContext";
|
||||||
|
import { RolesListPage } from "./role-management/RolesListPage";
|
||||||
|
import { useSearchParams } from "react-router-dom";
|
||||||
|
|
||||||
type SettingsTab =
|
type SettingsTab =
|
||||||
| "subscription"
|
| "subscription"
|
||||||
|
|
@ -39,6 +41,17 @@ type SettingsTab =
|
||||||
| "security"
|
| "security"
|
||||||
| "appearance";
|
| "appearance";
|
||||||
|
|
||||||
|
const SETTINGS_TABS: SettingsTab[] = [
|
||||||
|
"subscription",
|
||||||
|
"app-versions",
|
||||||
|
"security",
|
||||||
|
"appearance",
|
||||||
|
]
|
||||||
|
|
||||||
|
function isSettingsTab(value: string | null): value is SettingsTab {
|
||||||
|
return value != null && (SETTINGS_TABS as string[]).includes(value)
|
||||||
|
}
|
||||||
|
|
||||||
const tabs: { id: SettingsTab; label: string; icon: typeof Shield }[] = [
|
const tabs: { id: SettingsTab; label: string; icon: typeof Shield }[] = [
|
||||||
{ id: "subscription", label: "Subscription packages", icon: CreditCard },
|
{ id: "subscription", label: "Subscription packages", icon: CreditCard },
|
||||||
{ id: "app-versions", label: "App versions", icon: Smartphone },
|
{ id: "app-versions", label: "App versions", icon: Smartphone },
|
||||||
|
|
@ -197,6 +210,8 @@ function SecurityTab({ memberId }: { memberId: number }) {
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
<RolesListPage embedded />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -352,11 +367,26 @@ function AppearanceTab() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SettingsPage() {
|
export function SettingsPage() {
|
||||||
const [activeTab, setActiveTab] = useState<SettingsTab>("subscription");
|
const [searchParams, setSearchParams] = useSearchParams();
|
||||||
|
const tabFromUrl = searchParams.get("tab");
|
||||||
|
const [activeTab, setActiveTab] = useState<SettingsTab>(() =>
|
||||||
|
isSettingsTab(tabFromUrl) ? tabFromUrl : "subscription",
|
||||||
|
);
|
||||||
const [profile, setProfile] = useState<TeamMeProfile | null>(null);
|
const [profile, setProfile] = useState<TeamMeProfile | null>(null);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isSettingsTab(tabFromUrl) && tabFromUrl !== activeTab) {
|
||||||
|
setActiveTab(tabFromUrl);
|
||||||
|
}
|
||||||
|
}, [tabFromUrl, activeTab]);
|
||||||
|
|
||||||
|
const selectTab = (tab: SettingsTab) => {
|
||||||
|
setActiveTab(tab);
|
||||||
|
setSearchParams(tab === "subscription" ? {} : { tab }, { replace: true });
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchProfile = async () => {
|
const fetchProfile = async () => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -423,7 +453,7 @@ export function SettingsPage() {
|
||||||
<button
|
<button
|
||||||
key={tab.id}
|
key={tab.id}
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setActiveTab(tab.id)}
|
onClick={() => selectTab(tab.id)}
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex shrink-0 items-center gap-2 whitespace-nowrap border-b-2 px-4 py-3 text-sm font-medium transition-colors",
|
"flex shrink-0 items-center gap-2 whitespace-nowrap border-b-2 px-4 py-3 text-sm font-medium transition-colors",
|
||||||
active
|
active
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ export function PersonaAccessDenied({ apiForbidden = false }: PersonaAccessDenie
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
<Button variant="outline" asChild>
|
<Button variant="outline" asChild>
|
||||||
<Link to="/roles">Manage roles</Link>
|
<Link to="/settings?tab=security">Manage roles</Link>
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ export function RatingsAccessDenied({ apiForbidden = false }: RatingsAccessDenie
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
<Button variant="outline" asChild>
|
<Button variant="outline" asChild>
|
||||||
<Link to="/roles">Manage roles</Link>
|
<Link to="/settings?tab=security">Manage roles</Link>
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,6 @@ import {
|
||||||
Search,
|
Search,
|
||||||
Shield,
|
Shield,
|
||||||
ShieldCheck,
|
ShieldCheck,
|
||||||
ChevronDown,
|
|
||||||
ChevronLeft,
|
|
||||||
ChevronRight,
|
|
||||||
AlertCircle,
|
AlertCircle,
|
||||||
Eye,
|
Eye,
|
||||||
X,
|
X,
|
||||||
|
|
@ -37,18 +34,24 @@ import {
|
||||||
} from "../../api/rbac.api"
|
} from "../../api/rbac.api"
|
||||||
import type { Role, RoleDetail, RolePermission } from "../../types/rbac.types"
|
import type { Role, RoleDetail, RolePermission } from "../../types/rbac.types"
|
||||||
import { cn } from "../../lib/utils"
|
import { cn } from "../../lib/utils"
|
||||||
import { DEFAULT_TABLE_PAGE_SIZE, TABLE_PAGE_SIZE_OPTIONS } from "../../lib/tablePagination"
|
|
||||||
import { toast } from "sonner"
|
import { toast } from "sonner"
|
||||||
import { SpinnerIcon } from "../../components/ui/spinner-icon"
|
import { SpinnerIcon } from "../../components/ui/spinner-icon"
|
||||||
import { InviteTeamMemberDialog } from "./components/InviteTeamMemberDialog"
|
import { InviteTeamMemberDialog } from "./components/InviteTeamMemberDialog"
|
||||||
import { SuperAdminOnly } from "../../components/access/AdminAccessGates"
|
import { SuperAdminOnly } from "../../components/access/AdminAccessGates"
|
||||||
|
import { useAdminAccess } from "../../hooks/useAdminAccess"
|
||||||
import { STAFF_TEAM_ROLE_OPTIONS } from "../../lib/teamRoles"
|
import { STAFF_TEAM_ROLE_OPTIONS } from "../../lib/teamRoles"
|
||||||
import {
|
import {
|
||||||
matchesRoleManagementCategory,
|
matchesRoleManagementCategory,
|
||||||
type RoleManagementCategory,
|
type RoleManagementCategory,
|
||||||
} from "../../lib/rbacRoleCategories"
|
} from "../../lib/rbacRoleCategories"
|
||||||
|
|
||||||
export function RolesListPage() {
|
type RolesListPageProps = {
|
||||||
|
/** Compact layout when nested under Settings → Security. */
|
||||||
|
embedded?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export function RolesListPage({ embedded = false }: RolesListPageProps) {
|
||||||
|
const { canInviteTeam: canEditRoles } = useAdminAccess()
|
||||||
const staffRoleNames = useMemo(
|
const staffRoleNames = useMemo(
|
||||||
() => new Set(STAFF_TEAM_ROLE_OPTIONS.map((o) => o.value)),
|
() => new Set(STAFF_TEAM_ROLE_OPTIONS.map((o) => o.value)),
|
||||||
[],
|
[],
|
||||||
|
|
@ -57,10 +60,6 @@ export function RolesListPage() {
|
||||||
// List state
|
// List state
|
||||||
const [roles, setRoles] = useState<Role[]>([])
|
const [roles, setRoles] = useState<Role[]>([])
|
||||||
const [roleCategoryFilter, setRoleCategoryFilter] = useState<RoleManagementCategory>("team")
|
const [roleCategoryFilter, setRoleCategoryFilter] = useState<RoleManagementCategory>("team")
|
||||||
const [page, setPage] = useState(1)
|
|
||||||
const [pageSize, setPageSize] = useState(DEFAULT_TABLE_PAGE_SIZE)
|
|
||||||
const [query, setQuery] = useState("")
|
|
||||||
const [debouncedQuery, setDebouncedQuery] = useState("")
|
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const [error, setError] = useState<string | null>(null)
|
const [error, setError] = useState<string | null>(null)
|
||||||
|
|
||||||
|
|
@ -97,33 +96,18 @@ export function RolesListPage() {
|
||||||
|
|
||||||
const [inviteForRole, setInviteForRole] = useState<Role | null>(null)
|
const [inviteForRole, setInviteForRole] = useState<Role | null>(null)
|
||||||
|
|
||||||
// Debounce search query
|
|
||||||
useEffect(() => {
|
|
||||||
const timer = setTimeout(() => {
|
|
||||||
setDebouncedQuery(query)
|
|
||||||
setPage(1)
|
|
||||||
}, 400)
|
|
||||||
return () => clearTimeout(timer)
|
|
||||||
}, [query])
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setPage(1)
|
|
||||||
}, [roleCategoryFilter])
|
|
||||||
|
|
||||||
const fetchRoles = useCallback(async () => {
|
const fetchRoles = useCallback(async () => {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
setError(null)
|
setError(null)
|
||||||
try {
|
try {
|
||||||
const all = await fetchAllRoles({
|
const all = await fetchAllRoles()
|
||||||
query: debouncedQuery || undefined,
|
|
||||||
})
|
|
||||||
setRoles(all)
|
setRoles(all)
|
||||||
} catch {
|
} catch {
|
||||||
setError("Failed to load roles.")
|
setError("Failed to load roles.")
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}, [debouncedQuery])
|
}, [])
|
||||||
|
|
||||||
// Fetch roles
|
// Fetch roles
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -346,22 +330,24 @@ export function RolesListPage() {
|
||||||
[roles, roleCategoryFilter],
|
[roles, roleCategoryFilter],
|
||||||
)
|
)
|
||||||
|
|
||||||
const total = filteredRoles.length
|
|
||||||
const totalPages = Math.max(1, Math.ceil(total / pageSize))
|
|
||||||
const safePage = Math.min(page, totalPages)
|
|
||||||
|
|
||||||
const paginatedRoles = useMemo(() => {
|
|
||||||
const start = (safePage - 1) * pageSize
|
|
||||||
return filteredRoles.slice(start, start + pageSize)
|
|
||||||
}, [filteredRoles, safePage, pageSize])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6">
|
<div className={cn("space-y-6", embedded && "space-y-4")}>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold tracking-tight text-grayScale-700">Role Management</h1>
|
<h2
|
||||||
|
className={cn(
|
||||||
|
"font-bold tracking-tight text-grayScale-700",
|
||||||
|
embedded ? "text-lg" : "text-2xl",
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{embedded ? "Roles" : "Role Management"}
|
||||||
|
</h2>
|
||||||
<p className="mt-1 text-sm text-grayScale-400">
|
<p className="mt-1 text-sm text-grayScale-400">
|
||||||
Manage roles and their permissions.
|
{embedded
|
||||||
|
? canEditRoles
|
||||||
|
? "View and edit system roles and permissions."
|
||||||
|
: "View system roles and permissions. Only Super Admins can make changes."
|
||||||
|
: "Manage roles and their permissions."}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -388,26 +374,6 @@ export function RolesListPage() {
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Search */}
|
|
||||||
<div className="relative max-w-sm">
|
|
||||||
<Search className="absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-grayScale-400" />
|
|
||||||
<Input
|
|
||||||
value={query}
|
|
||||||
onChange={(e) => setQuery(e.target.value)}
|
|
||||||
placeholder="Search roles…"
|
|
||||||
className="pl-9"
|
|
||||||
/>
|
|
||||||
{query && (
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => setQuery("")}
|
|
||||||
className="absolute right-3 top-1/2 -translate-y-1/2 text-grayScale-400 hover:text-grayScale-600"
|
|
||||||
>
|
|
||||||
<X className="h-4 w-4" />
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Error */}
|
{/* Error */}
|
||||||
{error && (
|
{error && (
|
||||||
<div className="flex items-center gap-3 rounded-2xl border border-red-100 bg-red-50 px-5 py-4">
|
<div className="flex items-center gap-3 rounded-2xl border border-red-100 bg-red-50 px-5 py-4">
|
||||||
|
|
@ -432,9 +398,7 @@ export function RolesListPage() {
|
||||||
<Shield className="h-10 w-10 text-grayScale-300" />
|
<Shield className="h-10 w-10 text-grayScale-300" />
|
||||||
<p className="text-sm font-semibold text-grayScale-600">No roles found.</p>
|
<p className="text-sm font-semibold text-grayScale-600">No roles found.</p>
|
||||||
<p className="text-xs text-grayScale-400">
|
<p className="text-xs text-grayScale-400">
|
||||||
{debouncedQuery
|
{roleCategoryFilter === "team"
|
||||||
? `No roles match "${debouncedQuery}".`
|
|
||||||
: roleCategoryFilter === "team"
|
|
||||||
? "No team member roles match this view."
|
? "No team member roles match this view."
|
||||||
: "No user roles match this view."}
|
: "No user roles match this view."}
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -442,7 +406,7 @@ export function RolesListPage() {
|
||||||
</Card>
|
</Card>
|
||||||
) : (
|
) : (
|
||||||
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||||
{paginatedRoles.map((role) => (
|
{filteredRoles.map((role) => (
|
||||||
<Card
|
<Card
|
||||||
key={role.id}
|
key={role.id}
|
||||||
className="overflow-hidden border border-grayScale-100 shadow-sm transition-all hover:-translate-y-0.5 hover:shadow-md"
|
className="overflow-hidden border border-grayScale-100 shadow-sm transition-all hover:-translate-y-0.5 hover:shadow-md"
|
||||||
|
|
@ -518,6 +482,7 @@ export function RolesListPage() {
|
||||||
) : null}
|
) : null}
|
||||||
</SuperAdminOnly>
|
</SuperAdminOnly>
|
||||||
|
|
||||||
|
<SuperAdminOnly>
|
||||||
<div className="grid grid-cols-1 gap-2 sm:grid-cols-2">
|
<div className="grid grid-cols-1 gap-2 sm:grid-cols-2">
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
|
|
@ -542,12 +507,14 @@ export function RolesListPage() {
|
||||||
Reactivate all
|
Reactivate all
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
</SuperAdminOnly>
|
||||||
|
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<span className="text-[11px] text-grayScale-400">
|
<span className="text-[11px] text-grayScale-400">
|
||||||
Open details to view permissions
|
Open details to view permissions
|
||||||
</span>
|
</span>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
|
<SuperAdminOnly>
|
||||||
{!role.is_system && (
|
{!role.is_system && (
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
|
|
@ -561,6 +528,7 @@ export function RolesListPage() {
|
||||||
<Trash2 className="h-4 w-4" />
|
<Trash2 className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
</SuperAdminOnly>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
|
|
@ -577,63 +545,6 @@ export function RolesListPage() {
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Pagination */}
|
|
||||||
{total > 0 && (
|
|
||||||
<div className="flex flex-wrap items-center justify-between gap-3 border-t border-grayScale-100 pt-4 text-sm text-grayScale-500">
|
|
||||||
<div className="flex flex-wrap items-center gap-2">
|
|
||||||
<span>
|
|
||||||
Showing {(safePage - 1) * pageSize + 1}–{Math.min(safePage * pageSize, total)} of {total} roles
|
|
||||||
</span>
|
|
||||||
<span className="hidden h-4 w-px bg-grayScale-200 sm:inline" />
|
|
||||||
<span className="flex items-center gap-2">
|
|
||||||
Rows per page
|
|
||||||
<div className="relative">
|
|
||||||
<select
|
|
||||||
value={pageSize}
|
|
||||||
onChange={(e) => {
|
|
||||||
setPageSize(Number(e.target.value))
|
|
||||||
setPage(1)
|
|
||||||
}}
|
|
||||||
className="h-8 appearance-none rounded-md border bg-white pl-2 pr-7 text-sm font-medium text-grayScale-600 focus:outline-none"
|
|
||||||
>
|
|
||||||
{TABLE_PAGE_SIZE_OPTIONS.map((size) => (
|
|
||||||
<option key={size} value={size}>
|
|
||||||
{size}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
<ChevronDown className="pointer-events-none absolute right-2 top-1/2 h-3 w-3 -translate-y-1/2 text-grayScale-400" />
|
|
||||||
</div>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{totalPages > 1 ? (
|
|
||||||
<div className="flex items-center gap-1">
|
|
||||||
<Button
|
|
||||||
variant="outline"
|
|
||||||
size="icon"
|
|
||||||
className="h-8 w-8"
|
|
||||||
disabled={safePage <= 1}
|
|
||||||
onClick={() => setPage((p) => Math.max(1, p - 1))}
|
|
||||||
>
|
|
||||||
<ChevronLeft className="h-4 w-4" />
|
|
||||||
</Button>
|
|
||||||
<span className="px-3 text-xs font-medium text-grayScale-600">
|
|
||||||
{safePage} / {totalPages}
|
|
||||||
</span>
|
|
||||||
<Button
|
|
||||||
variant="outline"
|
|
||||||
size="icon"
|
|
||||||
className="h-8 w-8"
|
|
||||||
disabled={safePage >= totalPages}
|
|
||||||
onClick={() => setPage((p) => Math.min(totalPages, p + 1))}
|
|
||||||
>
|
|
||||||
<ChevronRight className="h-4 w-4" />
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -657,7 +568,7 @@ export function RolesListPage() {
|
||||||
<Shield className="h-5 w-5 text-brand-500" />
|
<Shield className="h-5 w-5 text-brand-500" />
|
||||||
)}
|
)}
|
||||||
{selectedRole?.name ?? "Role Details"}
|
{selectedRole?.name ?? "Role Details"}
|
||||||
{selectedRole && (
|
{selectedRole && canEditRoles && (
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
|
|
@ -748,7 +659,7 @@ export function RolesListPage() {
|
||||||
<div>
|
<div>
|
||||||
<div className="mb-3 flex items-center justify-between">
|
<div className="mb-3 flex items-center justify-between">
|
||||||
<h4 className="text-sm font-semibold text-grayScale-600">Permissions</h4>
|
<h4 className="text-sm font-semibold text-grayScale-600">Permissions</h4>
|
||||||
{!editingPermissions && (
|
{!editingPermissions && canEditRoles && (
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user