Only check roles if a user when accessing pages
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
90f1750945
commit
8d05864c15
@ -51,9 +51,11 @@ export const isAdminOrSelf = ({ req: { user } }: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const isAdminOrPublished = ({ req: { user } }: any) => {
|
export const isAdminOrPublished = ({ req: { user } }: any) => {
|
||||||
|
if (user && user.roles) {
|
||||||
if (user.roles?.includes('admin')) {
|
if (user.roles?.includes('admin')) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
_status: {
|
_status: {
|
||||||
|
Loading…
Reference in New Issue
Block a user