Skip to content

Commit

Permalink
Allow admins to update all models
Browse files Browse the repository at this point in the history
  • Loading branch information
JR40159 committed Jan 7, 2025
1 parent ad5036c commit 1b8d7ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/src/connectors/authorisation/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ export class BasicAuthorisationConnector {
return { id: model.id, success: false, info: 'You do not have permission to update a model card.' }
}

if (ModelAction.Update === action && (await missingRequiredRole(user, model, ['owner', 'mtr', 'msro']))) {
if (
ModelAction.Update === action &&
(await missingRequiredRole(user, model, ['owner', 'mtr', 'msro'])) &&
!(await authentication.hasRole(user, Roles.Admin))
) {
return { id: model.id, success: false, info: 'You do not have permission to update a model.' }
}

Expand Down

0 comments on commit 1b8d7ab

Please sign in to comment.