@@ 122-124 (lines=3) @@ | ||
119 | // if no entity is founded for this path lets try to find on trashed |
|
120 | if ($contentRecord === null || $contentRecord->count() !== 1) { |
|
121 | // check if user can access to content list on admin panel |
|
122 | if (!App::$User->isAuth() || !App::$User->identity()->getRole()->can('Admin/Content/Index')) { |
|
123 | throw new NotFoundException(); |
|
124 | } |
|
125 | // lets try to find in trashed |
|
126 | $contentRecord->withTrashed(); |
|
127 | // 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)) { |