Skip to content

Commit fce342c

Browse files
authored
[FIX] Cannot deactive a regular user if there's only one admin
user admin check at setUserActiveStatus
1 parent 6deb095 commit fce342c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/lib/server/functions/setUserActiveStatus.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function setUserActiveStatus(userId, active, confirmRelinquish = false) {
4343

4444
// Users without username can't do anything, so there is no need to check for owned rooms
4545
if (user.username != null && !active) {
46-
const userAdmin = Users.findOneAdmin(userId.count);
46+
const userAdmin = Users.findOneAdmin(userId);
4747
const adminsCount = Users.findActiveUsersInRoles(['admin']).count();
4848
if (userAdmin && adminsCount === 1) {
4949
throw new Meteor.Error('error-action-not-allowed', 'Leaving the app without an active admin is not allowed', {

0 commit comments

Comments
 (0)