feat: Add initial scope checks via decorators (#7737)
This commit is contained in:
@@ -109,8 +109,7 @@ EEWorkflowController.get(
|
||||
}
|
||||
|
||||
const userSharing = workflow.shared?.find((shared) => shared.user.id === req.user.id);
|
||||
|
||||
if (!userSharing && req.user.globalRole.name !== 'owner') {
|
||||
if (!userSharing && !(await req.user.hasGlobalScope('workflow:read'))) {
|
||||
throw new UnauthorizedError(
|
||||
'You do not have permission to access this workflow. Ask the owner to share it with you',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user