Skip to content

Commit

Permalink
skip new user role setting for updates to role via admin panel
Browse files Browse the repository at this point in the history
  • Loading branch information
murtaza98 committed Sep 7, 2023
1 parent 32e0068 commit 8f6c798
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/meteor/app/authentication/server/startup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ const insertUserDocAsync = async function (options, user) {

globalRoles = [...globalRoles];

const roles = getNewUserRoles(globalRoles);
const roles = options.skipNewUserRolesSetting ? globalRoles : getNewUserRoles(globalRoles);

if (!user.type) {
user.type = 'user';
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/app/lib/server/functions/saveUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ const saveNewUser = async function (userData, sendPassword) {
joinDefaultChannels: userData.joinDefaultChannels,
isGuest,
globalRoles: roles,
skipNewUserRolesSetting: true,
};
if (userData.email) {
createUser.email = userData.email;
Expand Down

0 comments on commit 8f6c798

Please sign in to comment.