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