Skip to content

Commit

Permalink
roles
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman committed Sep 6, 2023
1 parent 8ef0b38 commit d1da919
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/meteor/app/lib/server/functions/saveUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ const saveNewUser = async function (userData, sendPassword) {
password: userData.password,
joinDefaultChannels: userData.joinDefaultChannels,
isGuest,
globalRoles: roles,
};
if (userData.email) {
createUser.email = userData.email;
Expand All @@ -288,7 +289,6 @@ const saveNewUser = async function (userData, sendPassword) {

const updateUser = {
$set: {
roles,
...(typeof userData.name !== 'undefined' && { name: userData.name }),
settings: userData.settings || {},
},
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/lib/callbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type {
InquiryWithAgentInfo,
ILivechatTagRecord,
TransferData,
AtLeast,
} from '@rocket.chat/core-typings';
import type { FilterOperators } from 'mongodb';

Expand Down Expand Up @@ -124,7 +125,7 @@ type ChainedCallbackSignatures = {
'livechat.onLoadConfigApi': (config: { room: IOmnichannelRoom }) => Record<string, unknown>;

'beforeSaveMessage': (message: IMessage, room?: IRoom) => IMessage;
'afterCreateUser': (user: IUser) => IUser;
'afterCreateUser': (user: AtLeast<IUser, '_id' | 'username' | 'roles'>) => IUser;
'afterDeleteRoom': (rid: IRoom['_id']) => IRoom['_id'];
'livechat:afterOnHold': (room: Pick<IOmnichannelRoom, '_id'>) => Pick<IOmnichannelRoom, '_id'>;
'livechat:afterOnHoldChatResumed': (room: Pick<IOmnichannelRoom, '_id'>) => Pick<IOmnichannelRoom, '_id'>;
Expand Down

0 comments on commit d1da919

Please sign in to comment.