service = $service; $this->userSession = $userSession; } private function getUID() { return $this->userSession->getUser()->getUID(); } /** * @NoAdminRequired * @throws \OCP\PreConditionNotMetException */ public function set() { $this->service->set( $this->getUID(), $this->request->getParams() ); return $this->get(); } /** * @NoAdminRequired */ public function get() { return new JSONResponse($this->service->getAll($this->getUID())); } }