| @@ 111-113 (lines=3) @@ | ||
| 108 | // if no entity is founded for this path lets try to find on trashed |
|
| 109 | if ($contentRecord === null || $contentRecord->count() !== 1) { |
|
| 110 | // check if user can access to content list on admin panel |
|
| 111 | if (!App::$User->isAuth() || !App::$User->identity()->getRole()->can('Admin/Content/Index')) { |
|
| 112 | throw new NotFoundException(); |
|
| 113 | } |
|
| 114 | // lets try to find in trashed |
|
| 115 | $contentRecord->withTrashed(); |
|
| 116 | // no way, lets throw exception |
|
| @@ 114-116 (lines=3) @@ | ||
| 111 | } |
|
| 112 | ||
| 113 | // check if user have permission to access there |
|
| 114 | if (!App::$User->isAuth() || !App::$User->identity()->getRole()->can('global/file')) { |
|
| 115 | throw new NativeException(__('Permissions to upload is denied')); |
|
| 116 | } |
|
| 117 | ||
| 118 | // check if directory exist |
|
| 119 | if (!Directory::exist('/upload/gallery/' . $id)) { |
|
| @@ 196-198 (lines=3) @@ | ||
| 193 | } |
|
| 194 | ||
| 195 | // check if user have permission to access there |
|
| 196 | if (!App::$User->isAuth() || !App::$User->identity()->getRole()->can('global/file')) { |
|
| 197 | throw new NativeException('Permission denied'); |
|
| 198 | } |
|
| 199 | ||
| 200 | $thumbDir = Normalize::diskFullPath('/upload/gallery/' . $id . '/orig/'); |
|
| 201 | if (!Directory::exist($thumbDir)) { |
|