mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
Merge pull request #184 from creative-commoners/pulls/2.0/bug-can-edit-permissions-fix
FIX Removed duplicate permission check + removed SITETREEE_VIEW_ALL
This commit is contained in:
commit
9d117d6f49
@ -134,7 +134,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface
|
||||
}
|
||||
|
||||
if ($this->CanViewType == 'OnlyTheseUsers' && $this->ViewerGroups()->count()) {
|
||||
return ($member && $member->inGroups($this->ViewerGroups()));
|
||||
return ($member && $member->inGroups($this->ViewerGroups()) || $this->canEdit($member));
|
||||
}
|
||||
|
||||
return $this->canEdit($member);
|
||||
@ -155,15 +155,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface
|
||||
}
|
||||
|
||||
// Do early admin check
|
||||
if ($member && Permission::checkMember(
|
||||
$member,
|
||||
array(
|
||||
'ADMIN',
|
||||
'SITETREE_EDIT_ALL',
|
||||
'SITETREE_VIEW_ALL',
|
||||
)
|
||||
)
|
||||
) {
|
||||
if ($member && Permission::checkMember($member, array('ADMIN','SITETREE_EDIT_ALL'))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -175,7 +167,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface
|
||||
return $member && $member->inGroups($this->EditorGroups());
|
||||
}
|
||||
|
||||
return ($member && Permission::checkMember($member, array('ADMIN', 'SITETREE_EDIT_ALL')));
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user