slides: grantable slides.manage permission for non-admin curators

This commit is contained in:
2026-07-29 08:41:53 -04:00
parent 02147827f0
commit eeae042aa8
8 changed files with 106 additions and 10 deletions

View File

@@ -167,6 +167,11 @@ router.beforeEach(async (to, from, next) => {
if (to.meta.requiresAdmin && !authStore.isAdmin) {
return next('/')
}
// A route may gate on a named permission instead of full admin (e.g. the
// slide manager -> slides.manage). Admins pass via hasPermission.
if (to.meta.requiresPermission && !authStore.hasPermission(to.meta.requiresPermission)) {
return next('/')
}
if (to.meta.guest && authStore.isAuthenticated) {
return next('/')
}