mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
FIX Removed duplicate permission check + SITETREEE_VIEW_ALL permission from DMSDocument::canEdit
This commit is contained in:
parent
a5ffec88bd
commit
e2eead8888
@ -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