Skip to content

Commit

Permalink
Merge branch 'develop' into fix/license
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] committed Jun 18, 2024
2 parents bb6b4c1 + ffbbd8c commit 24b463f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions apps/meteor/server/lib/roles/createOrUpdateProtectedRole.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { IRole, AtLeast } from '@rocket.chat/core-typings';
import { Roles } from '@rocket.chat/models';

import { notifyOnRoleChanged, notifyOnRoleChangedById } from '../../../app/lib/server/lib/notifyListener';

export const createOrUpdateProtectedRoleAsync = async (
roleId: string,
roleData: AtLeast<Omit<IRole, '_id' | 'protected'>, 'name'>,
Expand All @@ -12,16 +10,14 @@ export const createOrUpdateProtectedRoleAsync = async (
});

if (role) {
const updatedRole = await Roles.updateById(
await Roles.updateById(
roleId,
roleData.name || role.name,
roleData.scope || role.scope,
roleData.description || role.description,
roleData.mandatory2fa || role.mandatory2fa,
);

void notifyOnRoleChanged(updatedRole);

return;
}

Expand All @@ -33,6 +29,4 @@ export const createOrUpdateProtectedRoleAsync = async (
...roleData,
protected: true,
});

void notifyOnRoleChangedById(roleId);
};

0 comments on commit 24b463f

Please sign in to comment.