Merge pull request #5319 from tsiegleauq/fix-admin-self-set-present
Fixes an issue regarding self-set-present
This commit is contained in:
commit
2c548d2dfb
@ -428,10 +428,10 @@ export class UserListComponent extends BaseListViewComponent<ViewUser> implement
|
|||||||
public setPresent(viewUser: ViewUser): void {
|
public setPresent(viewUser: ViewUser): void {
|
||||||
viewUser.user.is_present = !viewUser.user.is_present;
|
viewUser.user.is_present = !viewUser.user.is_present;
|
||||||
|
|
||||||
if (this.operator.viewUser === viewUser) {
|
if (this.operator.hasPerms('users.can_manage')) {
|
||||||
this.operator.setPresence(viewUser.user.is_present).catch(this.raiseError);
|
|
||||||
} else {
|
|
||||||
this.repo.update(viewUser.user, viewUser).catch(this.raiseError);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user