be sure user isAdmin

This commit is contained in:
Ben0it-T 2021-12-22 13:48:37 +01:00
parent b876098dc4
commit 349925ad6b

View file

@ -1302,6 +1302,7 @@ if (Meteor.isServer) {
setUsersTeamsTeamDisplayName(teamId, teamDisplayName) {
check(teamId, String);
check(teamDisplayName, String);
if (Meteor.user() && Meteor.user().isAdmin) {
Users.find({
teams: {
$elemMatch: {teamId: teamId}
@ -1318,10 +1319,12 @@ if (Meteor.isServer) {
}
});
});
}
},
setUsersOrgsOrgDisplayName(orgId, orgDisplayName) {
check(orgId, String);
check(orgDisplayName, String);
if (Meteor.user() && Meteor.user().isAdmin) {
Users.find({
orgs: {
$elemMatch: {orgId: orgId}
@ -1338,6 +1341,7 @@ if (Meteor.isServer) {
}
});
});
}
},
});
Accounts.onCreateUser((options, user) => {