* get own report details * falls back to panoramas shared with the current user * * @param int $panoramaId * @return array * @throws Exception */
(int $panoramaId)
| 110 | * @throws Exception |
| 111 | */ |
| 112 | public function read(int $panoramaId) { |
| 113 | $ownReport = $this->PanoramaMapper->readOwn($panoramaId); |
| 114 | if ($ownReport) { |
| 115 | $ownReport['permissions'] = \OCP\Constants::PERMISSION_UPDATE; |
| 116 | } else { |
| 117 | $sharedPanorama = $this->ShareService->getSharedPanorama($panoramaId); |
| 118 | if (!empty($sharedPanorama)) { |
| 119 | // ToDo: panoramas do not have an edit logic. to be added later |
| 120 | $sharedPanorama['permissions'] = \OCP\Constants::PERMISSION_READ; |
| 121 | $keysToKeep = array('id', 'name', 'dataset', 'favorite', 'parent', 'type', 'pages', 'filters', 'isShare', 'shareId', 'permissions'); |
| 122 | $ownReport = array_intersect_key($sharedPanorama, array_flip($keysToKeep)); |
| 123 | } |
| 124 | } |
| 125 | return $ownReport; |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Resolve a selected panorama picture to its file id. |
nothing calls this directly
no test coverage detected