slides: grantable slides.manage permission for non-admin curators
This commit is contained in:
@@ -13,6 +13,13 @@ export const useAuthStore = defineStore('auth', {
|
||||
roles: (state) => state.user?.roles || [],
|
||||
hasRole: (state) => (role) => state.user?.roles?.includes(role) || false,
|
||||
isAdmin: (state) => state.user?.roles?.includes('admin') || false,
|
||||
// True if the user holds a named permission. Admins hold every permission
|
||||
// (mirrors the backend require_permission admin bypass), so they pass
|
||||
// regardless of the permissions list. Non-admins check their granted list.
|
||||
hasPermission: (state) => (name) =>
|
||||
state.user?.roles?.includes('admin')
|
||||
|| state.user?.permissions?.includes(name)
|
||||
|| false,
|
||||
// True when an admin-set temporary password must be changed before use.
|
||||
mustChangePassword: (state) => !!state.user?.mustchangepassword,
|
||||
// Full name from the employee directory (falls back to username/SSO).
|
||||
|
||||
Reference in New Issue
Block a user