@@ 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)) { |
|
@@ 115-117 (lines=3) @@ | ||
112 | } |
|
113 | ||
114 | // check if user have permission to access there |
|
115 | if (!App::$User->isAuth() || !App::$User->identity()->getRole()->can('global/file')) { |
|
116 | throw new NativeException(__('Permissions to upload is denied')); |
|
117 | } |
|
118 | ||
119 | // check if directory exist |
|
120 | if (!Directory::exist('/upload/gallery/' . $id)) { |
@@ 123-125 (lines=3) @@ | ||
120 | // if no entity is founded for this path lets try to find on trashed |
|
121 | if ($contentRecord === null || $contentRecord->count() !== 1) { |
|
122 | // check if user can access to content list on admin panel |
|
123 | if (!App::$User->isAuth() || !App::$User->identity()->getRole()->can('Admin/Content/Index')) { |
|
124 | throw new NotFoundException(); |
|
125 | } |
|
126 | // lets try to find in trashed |
|
127 | $contentRecord->withTrashed(); |
|
128 | // no way, lets throw exception |