Code Duplication    Length = 3-3 lines in 6 locations

code/cms/DMSDocumentAddController.php 1 location

@@ 328-330 (lines=3) @@
325
     */
326
    public function canView($member = null)
327
    {
328
        if (!$member || !(is_a($member, 'Member')) || is_numeric($member)) {
329
            $member = Member::currentUser();
330
        }
331
332
        // Do early admin check
333
        if ($member &&

code/model/DMSDocument.php 4 locations

@@ 103-105 (lines=3) @@
100
101
    public function canView($member = null)
102
    {
103
        if (!$member || !(is_a($member, 'Member')) || is_numeric($member)) {
104
            $member = Member::currentUser();
105
        }
106
107
        // extended access checks
108
        $results = $this->extend('canView', $member);
@@ 145-147 (lines=3) @@
142
143
    public function canEdit($member = null)
144
    {
145
        if (!$member || !(is_a($member, 'Member')) || is_numeric($member)) {
146
            $member = Member::currentUser();
147
        }
148
149
        $results = $this->extend('canEdit', $member);
150
@@ 188-190 (lines=3) @@
185
     */
186
    public function canCreate($member = null)
187
    {
188
        if (!$member || !(is_a($member, 'Member')) || is_numeric($member)) {
189
            $member = Member::currentUser();
190
        }
191
192
        $results = $this->extend('canCreate', $member);
193
@@ 222-224 (lines=3) @@
219
     */
220
    public function canDelete($member = null)
221
    {
222
        if (!$member || !(is_a($member, 'Member')) || is_numeric($member)) {
223
            $member = Member::currentUser();
224
        }
225
226
        $results = $this->extend('canDelete', $member);
227

code/model/DMSDocumentSet.php 1 location

@@ 397-399 (lines=3) @@
394
     */
395
    public function getDMSDocumentSetPermissions(Member $member = null)
396
    {
397
        if (!$member || !(is_a($member, 'Member')) || is_numeric($member)) {
398
            $member = Member::currentUser();
399
        }
400
401
        $result = ($member &&
402
            Permission::checkMember(