change: move version display to

This commit is contained in:
Julian Krauser 2025-02-07 13:23:53 +01:00
parent 4a5aec36dd
commit 117372af39
5 changed files with 49 additions and 51 deletions

View file

@ -43,6 +43,11 @@ export const useAbilityStore = defineStore("ability", {
return true;
return false;
},
isAdmin: (state) => (): boolean => {
const permissions = state.permissions;
if (state.isOwner) return true;
return permissions?.admin ?? false;
},
_can:
() =>
(

View file

@ -134,6 +134,7 @@ export const useNavigationStore = defineStore("navigation", {
...(abilityStore.can("read", "user", "role") ? [{ key: "role", title: "Rollen" }] : []),
...(abilityStore.can("read", "user", "webapi") ? [{ key: "webapi", title: "Webapi-Token" }] : []),
...(abilityStore.can("read", "user", "backup") ? [{ key: "backup", title: "Backups" }] : []),
...(abilityStore.isAdmin() ? [{ key: "version", title: "Version" }] : []),
],
},
} as navigationModel;