diff options
author | dartcafe <github@dartcafe.de> | 2021-03-02 21:32:15 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2021-03-02 21:32:15 +0300 |
commit | 7b2e40a4ad0efd84eac7e863748c4e438598ac74 (patch) | |
tree | fd738d774148dedbbf14f49181aa2d01f35ce19a /lib/Model/Acl.php | |
parent | 902a7a7e066f0a9f8481da6ad8108cf18412573a (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.php | 12 |
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(), ]; } |