mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 16:32:31 +01:00
fix (authorization): upload button toggle
This commit is contained in:
parent
ca68df76ab
commit
7b2bd6a0fc
2 changed files with 2 additions and 1 deletions
|
|
@ -24,7 +24,7 @@ export default async function(render) {
|
||||||
}
|
}
|
||||||
|
|
||||||
effect(getPermission().pipe(
|
effect(getPermission().pipe(
|
||||||
rxjs.filter(() => calculatePermission(currentPath(), "new-file")),
|
rxjs.filter(() => calculatePermission(currentPath(), "upload")),
|
||||||
rxjs.tap(() => {
|
rxjs.tap(() => {
|
||||||
const $page = createFragment(`
|
const $page = createFragment(`
|
||||||
<div is="component_filezone"></div>
|
<div is="component_filezone"></div>
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ export function calculatePermission(path, action) {
|
||||||
case "new-folder": return toBool(perms$.value[path]["can_create_directory"]);
|
case "new-folder": return toBool(perms$.value[path]["can_create_directory"]);
|
||||||
case "delete": return toBool(perms$.value[path]["can_delete"]);
|
case "delete": return toBool(perms$.value[path]["can_delete"]);
|
||||||
case "rename": return toBool(perms$.value[path]["can_rename"]);
|
case "rename": return toBool(perms$.value[path]["can_rename"]);
|
||||||
|
case "upload": return toBool(perms$.value[path]["can_upload"]);
|
||||||
default: return false;
|
default: return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue