* create a new share * * @param $item_type * @param $item_source * @param $type * @param $user * @return DataResponse * @throws Exception */
($item_type, $item_source, $type, $user)
| 57 | * @throws Exception |
| 58 | */ |
| 59 | #[NoAdminRequired] |
| 60 | public function create($item_type, $item_source, $type, $user) { |
| 61 | if (($item_type === ShareService::SHARE_ITEM_TYPE_REPORT && $this->ReportService->isOwn($item_source)) |
| 62 | || ($item_type === ShareService::SHARE_ITEM_TYPE_PANORAMA && $this->PanoramaService->isOwn($item_source))) { |
| 63 | return new DataResponse($this->ShareService->create($item_type, $item_source, $type, $user)); |
| 64 | } else { |
| 65 | return new DataResponse(false); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * get all shares for a report |