Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(permissions): don't use auth check to block view permissions (#2042)

teo0b72d5b3366a
diff --git a/js/app/packages/core/signal/permissions.ts b/js/app/packages/core/signal/permissions.ts
index ed5f048f2d..d7e8028559 100644
--- a/js/app/packages/core/signal/permissions.ts
+++ b/js/app/packages/core/signal/permissions.ts
@@ -16,12 +16,10 @@ import {
} from './load';
export const useGetPermissions = () => {
- const isAuthenticated = useIsAuthenticated();
// NOTE: if the dss file is available, we can assume the user can view
const fileExists = createMemo(() => !!blockFileSignal());
const accessLevel = createMemo(() => {
- if (!isAuthenticated()) return undefined;
const accessLevel_ = blockUserAccessSignal();
if (!accessLevel_ && fileExists()) return AccessLevel.view;
return accessLevel_;
@@ -55,10 +53,12 @@ export const useIsEditable = () => {
};
export const usePermissionCan = (requestedPermissions: Permissions) => {
+ const isAuthenticated = useIsAuthenticated();
const hasAccess = useHasAccess(requestedPermissions);
const isEditable = useIsEditable();
return createMemo(() => {
+ if (!isAuthenticated()) return false;
if (!hasAccess()) return false;
return isEditable();
});