mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Fix incomplete change in r66672
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@67152 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3a13be7703
commit
17e855da88
@ -523,7 +523,7 @@ class SiteTree extends DataObject {
|
||||
* @todo Check we get a endless recursion if we use parent::can()
|
||||
*/
|
||||
function can($perm, $member = null) {
|
||||
if(!isset($member)) $member = Member::currentUser();
|
||||
if(!$member && $member !== FALSE) $member = Member::currentUser();
|
||||
|
||||
if(Permission::checkMember($member, "ADMIN")) return true;
|
||||
|
||||
@ -560,9 +560,7 @@ class SiteTree extends DataObject {
|
||||
* @return boolean True if the current user can add children.
|
||||
*/
|
||||
public function canAddChildren($member = null) {
|
||||
if(!isset($member)) {
|
||||
$member = Member::currentUser();
|
||||
}
|
||||
if(!$member && $member !== FALSE) $member = Member::currentUser();
|
||||
if(Permission::checkMember($member, "ADMIN")) return true;
|
||||
|
||||
// DEPRECATED 2.3: use canAddChildren() instead
|
||||
@ -593,7 +591,7 @@ class SiteTree extends DataObject {
|
||||
* @return boolean True if the current user can view this page.
|
||||
*/
|
||||
public function canView($member = null) {
|
||||
if(!isset($member)) $member = Member::currentUser();
|
||||
if(!$member && $member !== FALSE) $member = Member::currentUser();
|
||||
|
||||
// admin override
|
||||
if(Permission::checkMember($member, "ADMIN")) return true;
|
||||
@ -648,7 +646,7 @@ class SiteTree extends DataObject {
|
||||
* @return boolean True if the current user can delete this page.
|
||||
*/
|
||||
public function canDelete($member = null) {
|
||||
if(!isset($member)) $member = Member::currentUser();
|
||||
if(!$member && $member !== FALSE) $member = Member::currentUser();
|
||||
|
||||
if(Permission::checkMember($member, "ADMIN")) return true;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user