Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions surfsense_web/components/settings/roles-manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -260,13 +260,6 @@ export function RolesManager({ searchSpaceId }: { searchSpaceId: number }) {
(permission: string) => canPerform(access, permission),
[access]
);
Comment on lines 260 to 262
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The local callback here is hasPermission, not canPerform, so there's no shadow — canPerform resolves to the imported helper on line 29. The sister file team-content.tsx (touched in the same originating PR #1428) ships the identical pattern, so this patch only restores parity. No rename needed.

(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()),
Expand Down
Loading