mirror of
https://github.com/dyzulk/trustlab.git
synced 2026-01-26 13:32:06 +07:00
fix: allow owner role to access admin pages
This commit is contained in:
@@ -33,9 +33,9 @@ export default function UsersManagementClient() {
|
||||
|
||||
const { data, error, mutate, isLoading } = useSWR("/api/admin/users", fetcher);
|
||||
|
||||
const hasAdminAccess = ['admin', 'owner'].includes(currentUser?.role || '');
|
||||
const isOwner = currentUser?.role === "owner";
|
||||
const isAdmin = currentUser?.role === "admin";
|
||||
const { isAdmin, isOwner, isAdminOrOwner } = useAuth();
|
||||
const hasAdminAccess = isAdminOrOwner;
|
||||
|
||||
|
||||
const handleDelete = async (id: string) => {
|
||||
setIsDeleting(true);
|
||||
|
||||
Reference in New Issue
Block a user