1
0
Fork 0
mirror of synced 2024-06-27 18:40:42 +12:00

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

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
}