phase1: RLS simplified to tenant isolation only + canAccess fallback removed + useUserPermissions hook + security kernel docs
This commit is contained in:
@@ -24,9 +24,6 @@ export function ContactDetailPage() {
|
||||
const { hasPermission } = usePermission();
|
||||
const authUser = useAuthStore((state) => state.user);
|
||||
const canAccess = (perm: string): boolean => {
|
||||
if (authUser?.is_system_admin) return true;
|
||||
const perms = authUser?.permissions || [];
|
||||
if (perms.length === 0) return true;
|
||||
return hasPermission(perm);
|
||||
};
|
||||
|
||||
|
||||
@@ -45,9 +45,6 @@ export function ContactsListPage() {
|
||||
const { hasPermission } = usePermission();
|
||||
const authUser = useAuthStore((state) => state.user);
|
||||
const canAccess = (perm: string): boolean => {
|
||||
if (authUser?.is_system_admin) return true;
|
||||
const perms = authUser?.permissions || [];
|
||||
if (perms.length === 0) return true;
|
||||
return hasPermission(perm);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user