Merge pull request #86 from ashim-hq/fix/issue-72-auth-false-admin

fix: prevent admin escalation when AUTH_ENABLED=false
This commit is contained in:
Ashim
2026-04-21 23:42:18 +08:00
committed by GitHub
2 changed files with 10 additions and 19 deletions
+3 -10
View File
@@ -11,19 +11,12 @@ interface AuthState {
permissions: string[];
}
const ALL_PERMISSIONS = [
const USER_PERMISSIONS = [
"tools:use",
"files:own",
"files:all",
"apikeys:own",
"apikeys:all",
"pipelines:own",
"pipelines:all",
"settings:read",
"settings:write",
"users:manage",
"teams:manage",
"branding:manage",
];
export function useAuth() {
@@ -51,8 +44,8 @@ export function useAuth() {
authEnabled: false,
isAuthenticated: true,
mustChangePassword: false,
role: "admin",
permissions: ALL_PERMISSIONS,
role: "user",
permissions: USER_PERMISSIONS,
});
return;
}