mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API CHANGE Removed SiteTree->canView_page() - originally created under the false assumption that SiteTree->can('view_page') is still valid. Every canView() can be instance specific. Original patch by simon_w in r53183 and #2198
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63310 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
85e52eb568
commit
150d41b4c7
@ -592,31 +592,6 @@ class SiteTree extends DataObject {
|
|||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This function should return true if the current user can view this
|
|
||||||
* page.
|
|
||||||
*
|
|
||||||
* It can be overloaded to customise the security model for an
|
|
||||||
* application.
|
|
||||||
*
|
|
||||||
* @return boolean True if the current user can view this page.
|
|
||||||
*/
|
|
||||||
public function canView_page($member = null) {
|
|
||||||
if(!isset($member)) {
|
|
||||||
$member = Member::currentUser();
|
|
||||||
}
|
|
||||||
if($member && $member->isAdmin()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$args = array($member, true);
|
|
||||||
$this->extend('alternateCanView_page', $args);
|
|
||||||
if($args[1] == false) return false;
|
|
||||||
|
|
||||||
return $this->canView($member);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function should return true if the current user can delete this
|
* This function should return true if the current user can delete this
|
||||||
|
Loading…
Reference in New Issue
Block a user