diff --git a/web/frontend/src/pages/form/components/utils/useChangeAction.tsx b/web/frontend/src/pages/form/components/utils/useChangeAction.tsx index c17a2555..d9b81ebe 100644 --- a/web/frontend/src/pages/form/components/utils/useChangeAction.tsx +++ b/web/frontend/src/pages/form/components/utils/useChangeAction.tsx @@ -75,6 +75,10 @@ const useChangeAction = ( return authorization.has(subject) && authorization.get(subject).indexOf(action) !== -1; } + // requests to ENDPOINT_ADD_ROLE cannot be done in parallel because on the + // backend, auths are reloaded from the DB each time there is an update. + // While auths are reloaded, they cannot be checked in a predictable way. + // See isAuthorized, addPolicy, and addListPolicy in backend/src/authManager.ts async function sendVoters(providedScipers, formID) { const chunkSize = 1000; for (let i = 0; i < providedScipers.length; i += chunkSize) {