User is only allowed to vote if present and has not delegated his vote or has delegated his vote to a user who is present.

This commit is contained in:
Jochen Winzer 2020-12-09 10:36:27 +01:00
parent 5cc464b250
commit ec36d4d64e

View File

@ -41,12 +41,14 @@ export class PollProgressComponent extends BaseViewComponentDirective implements
map(users =>
/**
* Filter the users who would be able to vote:
* They are present or have their right to vote delegated
* They are present and don't have their vote right delegated
* or the have their vote delegated to a user who is present.
* They are in one of the voting groups
*/
users.filter(
user =>
(user.is_present || user.isVoteRightDelegated) &&
((user.is_present && !user.isVoteRightDelegated) ||
user.voteDelegatedTo?.is_present) &&
this.poll.groups_id.intersect(user.groups_id).length
)
)