Delete user builder and admin flags when specifying a custom role via dev tools

This commit is contained in:
Andrew Kingston 2022-06-09 14:26:56 +01:00
parent a0f1657087
commit 71b18a4260
1 changed files with 4 additions and 0 deletions

View File

@ -74,6 +74,10 @@ module.exports = async (ctx, next) => {
try {
await getRole(roleHeader)
roleId = roleHeader
// Delete admin and builder flags so that the specified role is honoured
delete ctx.user.builder
delete ctx.user.admin
} catch (error) {
// Swallow error and do nothing
}