mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-25 19:15:18 +02:00
fix(web): remove orphaned hasPermission inline body in roles-manager
PR #1428 (issue #1366) extracted the inline `hasPermission` callback into a shared `canPerform` helper but left the original arrow-function body, its dependency array, and trailing `)` behind after the new `useCallback` block. The result was a syntactically invalid statement that broke `pnpm build` on the `dev` branch and is now blocking every E2E job in the PR queue. Delete the orphaned lines so the file parses again. No behavior change — the working `useCallback(canPerform(access, permission))` already supplies the same predicate the duplicated body did.
This commit is contained in:
parent
63e5943cc8
commit
29d5ee5465
1 changed files with 1 additions and 8 deletions
|
|
@ -26,7 +26,7 @@ import {
|
|||
} from "lucide-react";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { myAccessAtom, canPerform } from "@/atoms/members/members-query.atoms";
|
||||
import { canPerform, myAccessAtom } from "@/atoms/members/members-query.atoms";
|
||||
import { permissionsAtom } from "@/atoms/permissions/permissions-query.atoms";
|
||||
import {
|
||||
createRoleMutationAtom,
|
||||
|
|
@ -260,13 +260,6 @@ export function RolesManager({ searchSpaceId }: { searchSpaceId: number }) {
|
|||
(permission: string) => canPerform(access, permission),
|
||||
[access]
|
||||
);
|
||||
(permission: string) => {
|
||||
if (!access) return false;
|
||||
if (access.is_owner) return true;
|
||||
return access.permissions?.includes(permission) ?? false;
|
||||
},
|
||||
[access]
|
||||
);
|
||||
|
||||
const { data: roles = [], isLoading: rolesLoading } = useQuery({
|
||||
queryKey: cacheKeys.roles.all(searchSpaceId.toString()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue