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:
Diffstat (limited to 'lib/Service/OptionService.php')
-rw-r--r--lib/Service/OptionService.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Service/OptionService.php b/lib/Service/OptionService.php
index 7208a154..0e2dbb88 100644
--- a/lib/Service/OptionService.php
+++ b/lib/Service/OptionService.php
@@ -103,6 +103,22 @@ class OptionService {
}
}
+ /**
+ * Get option
+ * @NoAdminRequired
+ * @param int $optionId
+ * @return Option
+ * @throws NotAuthorizedException
+ */
+ public function get($optionId) {
+
+ if (!$this->acl->set($this->optionMapper->find($optionId)->getPollId())->getAllowView()) {
+ throw new NotAuthorizedException;
+ }
+
+ return $this->optionMapper->find($optionId);
+ }
+
/**
* Add a new option