Boundary condition check for top-level pages with 'inherit' permission

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@66008 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-11-17 02:24:18 +00:00
parent 9a45672aa4
commit 176a865dc4

View File

@ -609,14 +609,13 @@ class SiteTree extends DataObject {
if($results && is_array($results)) if(!min($results)) return false;
// check for empty spec
if(
!$this->CanViewType || $this->CanViewType == 'Anyone'
) return true;
if(!$this->CanViewType || $this->CanViewType == 'Anyone') return true;
// check for inherit
if(
$this->CanViewType == 'Inherit' && $this->Parent()
) return $this->Parent()->canView($member);
if($this->CanViewType == 'Inherit') {
if($this->ParentID) return $this->Parent()->canView($member);
else return true;
}
// check for any logged-in users
if(
@ -743,14 +742,13 @@ class SiteTree extends DataObject {
if(!$this->canView()) return false;
// check for empty spec
if(
!$this->CanEditType || $this->CanEditType == 'Anyone'
) return true;
if(!$this->CanEditType || $this->CanEditType == 'Anyone') return true;
// check for inherit
if(
$this->CanEditType == 'Inherit' && $this->Parent()
) return $this->Parent()->canEdit($member);
if($this->CanEditType == 'Inherit') {
if($this->ParentID) return $this->Parent()->canEdit($member);
else return Permission::checkMember("CMS_ACCESS_CMSMain");
}
// check for any logged-in users
if(