Skip to content

Commit

Permalink
regression: don't notify role changes during startup (#32619)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego authored Jun 18, 2024
1 parent faf386b commit ffbbd8c
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 ffbbd8c

Please sign in to comment.