Code Duplication    Length = 3-3 lines in 3 locations

Apps/Controller/Front/Content.php 1 location

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

Apps/Controller/Api/Content.php 2 locations

@@ 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)) {