From 91d4b3c7afe220e85a827be504ff6e7682d2855b Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 20 Apr 2020 19:17:03 +0200 Subject: [PATCH] Fixes an issue regarding self-set-present --- .../site/users/components/user-list/user-list.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/app/site/users/components/user-list/user-list.component.ts b/client/src/app/site/users/components/user-list/user-list.component.ts index 2fd90a8c3..afb61c40d 100644 --- a/client/src/app/site/users/components/user-list/user-list.component.ts +++ b/client/src/app/site/users/components/user-list/user-list.component.ts @@ -428,10 +428,10 @@ export class UserListComponent extends BaseListViewComponent implement public setPresent(viewUser: ViewUser): void { viewUser.user.is_present = !viewUser.user.is_present; - if (this.operator.viewUser === viewUser) { - this.operator.setPresence(viewUser.user.is_present).catch(this.raiseError); - } else { + if (this.operator.hasPerms('users.can_manage')) { this.repo.update(viewUser.user, viewUser).catch(this.raiseError); + } else if (this.allowSelfSetPresent && this.operator.viewUser === viewUser) { + this.operator.setPresence(viewUser.user.is_present).catch(this.raiseError); } } }