| @@ 55-57 (lines=3) @@ | ||
| 52 | } |
|
| 53 | ||
| 54 | // check if user have permission to access there |
|
| 55 | if (!App::$User->isAuth() || !App::$User->identity()->getRole()->can('global/file')) { |
|
| 56 | throw new NativeException(__('Permissions to upload is denied')); |
|
| 57 | } |
|
| 58 | ||
| 59 | // check if directory exist |
|
| 60 | if (!Directory::exist('/upload/gallery/' . $id)) { |
|
| @@ 136-138 (lines=3) @@ | ||
| 133 | } |
|
| 134 | ||
| 135 | // check if user have permission to access there |
|
| 136 | if (!App::$User->isAuth() || !App::$User->identity()->getRole()->can('global/file')) { |
|
| 137 | throw new NativeException('Permission denied'); |
|
| 138 | } |
|
| 139 | ||
| 140 | $thumbDir = Normalize::diskFullPath('/upload/gallery/' . $id . '/orig/'); |
|
| 141 | if (!Directory::exist($thumbDir)) { |
|
| @@ 96-98 (lines=3) @@ | ||
| 93 | // if no entity is founded for this path lets try to find on trashed |
|
| 94 | if ($contentRecord === null || $contentRecord->count() !== 1) { |
|
| 95 | // check if user can access to content list on admin panel |
|
| 96 | if (!App::$User->isAuth() || !App::$User->identity()->getRole()->can('Admin/Content/Index')) { |
|
| 97 | throw new NotFoundException(); |
|
| 98 | } |
|
| 99 | // lets try to find in trashed |
|
| 100 | $contentRecord->withTrashed(); |
|
| 101 | // no way, lets throw exception |
|