Skip to content
Snippets Groups Projects
Unverified Commit baadaacd authored by Douglas Fabris's avatar Douglas Fabris Committed by GitHub
Browse files

[FIX] Role description not updating (#19236)


Co-authored-by: default avatarDiego Sampaio <chinello@gmail.com>
parent 6ec7dffc
No related branches found
No related tags found
No related merge requests found
......@@ -32,25 +32,12 @@ export class Roles extends Base {
const queryData = {
name,
scope,
protected: protectedRole,
};
const updateData = {
...queryData,
description,
protected: protectedRole,
mandatory2fa,
};
const exists = this.findOne({
_id: name,
...queryData,
}, { fields: { _id: 1 } });
if (exists) {
return exists._id;
}
this.upsert({ _id: name }, { $set: updateData });
this.upsert({ _id: name }, { $set: queryData });
}
addUserRoles(userId, roles, scope) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment