Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2021-03-02 21:32:15 +0300
committerdartcafe <github@dartcafe.de>2021-03-02 21:32:15 +0300
commit7b2e40a4ad0efd84eac7e863748c4e438598ac74 (patch)
treefd738d774148dedbbf14f49181aa2d01f35ce19a /lib/Model/Acl.php
parent902a7a7e066f0a9f8481da6ad8108cf18412573a (diff)
Hide counter and participants, if results are hidden
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'lib/Model/Acl.php')
-rw-r--r--lib/Model/Acl.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Model/Acl.php b/lib/Model/Acl.php
index e001afd0..a8c03dff 100644
--- a/lib/Model/Acl.php
+++ b/lib/Model/Acl.php
@@ -187,13 +187,9 @@ class Acl implements JsonSerializable {
case self::PERMISSION_VOTE:
return !$this->poll->getExpired() && $this->share->getType() !== Share::TYPE_PUBLIC;
case self::PERMISSION_SEE_RESULTS:
- if ($this->getIsOwner()) {
- return true;
- } elseif ($this->poll->getShowResults() === Poll::SHOW_RESULTS_ALWAYS) {
- return true;
- } elseif ($this->poll->getShowResults() === Poll::SHOW_RESULTS_CLOSED && $this->poll->getExpired()) {
- return true;
- }
+ return $this->getIsOwner()
+ || $this->poll->getShowResults() === Poll::SHOW_RESULTS_ALWAYS
+ || $this->poll->getShowResults() === Poll::SHOW_RESULTS_CLOSED && $this->poll->getExpired();
break;
case self::PERMISSION_SEE_USERNAMES:
return $this->getIsOwner() || !$this->poll->getAnonymous();
@@ -228,6 +224,8 @@ class Acl implements JsonSerializable {
'userHasVoted' => $this->getUserHasVoted(),
'userId' => $this->getUserId(),
'userIsInvolved' => $this->getUserIsInvolved(),
+ 'pollExpired' => $this->poll->getExpired(),
+ 'pollExpire' => $this->poll->getExpire(),
];
}