From 1e35c5b1cf14446556b02ecfdee9d5a98318c477 Mon Sep 17 00:00:00 2001 From: Stefano Ricci Date: Thu, 22 Aug 2024 12:52:02 +0200 Subject: [PATCH] fixed cannot demote single record --- collect-webapp/frontend/src/model/User.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/collect-webapp/frontend/src/model/User.js b/collect-webapp/frontend/src/model/User.js index 6e2fa45d28..9efa41ebcf 100644 --- a/collect-webapp/frontend/src/model/User.js +++ b/collect-webapp/frontend/src/model/User.js @@ -196,7 +196,12 @@ export default class User extends Serializable { const prevStep = Workflow.getPrevStep(recordStep) if (!prevStep) return false - return this.canEditRecord({ record, userInGroupRole: roleInGroup }) + switch (recordStep) { + case Workflow.STEPS.analysis: + return this._hasAtLeastRole(User.ROLE.ANALYSIS) + default: + return this.canEditRecord({ record, roleInGroup }) + } } canPromoteRecordWithErrors(roleInSurveyGroup) {