* get all shares for a report or panorama * * @param $item_source * @param $item_type * @return array * @throws Exception */
($item_type, $item_source)
| 110 | * @throws Exception |
| 111 | */ |
| 112 | public function read($item_type, $item_source) { |
| 113 | |
| 114 | $shares = $this->ShareMapper->getShares($item_type, $item_source); |
| 115 | foreach ($shares as $key => $share) { |
| 116 | if ((int)$share['type'] === self::SHARE_TYPE_USER) { |
| 117 | if (!$this->userManager->userExists($share['uid_owner'])) { |
| 118 | $this->ShareMapper->deleteShare($share['id']); |
| 119 | unset($shares[$key]); |
| 120 | continue; |
| 121 | } |
| 122 | $shares[$key]['displayName'] = $this->userManager->get($share['uid_owner'])->getDisplayName(); |
| 123 | } |
| 124 | $shares[$key]['pass'] = $share['pass'] !== null; |
| 125 | } |
| 126 | return $shares; |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * get all report by token |
no test coverage detected