slides: grantable slides.manage permission for non-admin curators
This commit is contained in:
@@ -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('/')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user