fix (authorization): upload button toggle

This commit is contained in:
MickaelK 2025-06-19 13:13:30 +10:00
parent ca68df76ab
commit 7b2bd6a0fc
2 changed files with 2 additions and 1 deletions

View file

@ -24,7 +24,7 @@ export default async function(render) {
}
effect(getPermission().pipe(
rxjs.filter(() => calculatePermission(currentPath(), "new-file")),
rxjs.filter(() => calculatePermission(currentPath(), "upload")),
rxjs.tap(() => {
const $page = createFragment(`
<div is="component_filezone"></div>

View file

@ -18,6 +18,7 @@ export function calculatePermission(path, action) {
case "new-folder": return toBool(perms$.value[path]["can_create_directory"]);
case "delete": return toBool(perms$.value[path]["can_delete"]);
case "rename": return toBool(perms$.value[path]["can_rename"]);
case "upload": return toBool(perms$.value[path]["can_upload"]);
default: return false;
}
}