mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed flaw logic checking for $member variable, since it's always set the alternative for choosing Member::currentUser() would never work.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@66638 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a2d5a9ac75
commit
0d450e6c3a
@ -523,7 +523,7 @@ class SiteTree extends DataObject {
|
|||||||
* @todo Check we get a endless recursion if we use parent::can()
|
* @todo Check we get a endless recursion if we use parent::can()
|
||||||
*/
|
*/
|
||||||
function can($perm, $member = null) {
|
function can($perm, $member = null) {
|
||||||
if(!isset($member)) $member = Member::currentUser();
|
if(!$member) $member = Member::currentUser();
|
||||||
|
|
||||||
if(Permission::checkMember($member, "ADMIN")) return true;
|
if(Permission::checkMember($member, "ADMIN")) return true;
|
||||||
|
|
||||||
@ -560,7 +560,7 @@ class SiteTree extends DataObject {
|
|||||||
* @return boolean True if the current user can add children.
|
* @return boolean True if the current user can add children.
|
||||||
*/
|
*/
|
||||||
public function canAddChildren($member = null) {
|
public function canAddChildren($member = null) {
|
||||||
if(!isset($member)) $member = Member::currentUser();
|
if(!$member) $member = Member::currentUser();
|
||||||
|
|
||||||
if(Permission::checkMember($member, "ADMIN")) return true;
|
if(Permission::checkMember($member, "ADMIN")) return true;
|
||||||
|
|
||||||
@ -592,7 +592,7 @@ class SiteTree extends DataObject {
|
|||||||
* @return boolean True if the current user can view this page.
|
* @return boolean True if the current user can view this page.
|
||||||
*/
|
*/
|
||||||
public function canView($member = null) {
|
public function canView($member = null) {
|
||||||
if(!isset($member)) $member = Member::currentUser();
|
if(!$member) $member = Member::currentUser();
|
||||||
|
|
||||||
// admin override
|
// admin override
|
||||||
if(Permission::checkMember($member, "ADMIN")) return true;
|
if(Permission::checkMember($member, "ADMIN")) return true;
|
||||||
@ -648,7 +648,7 @@ class SiteTree extends DataObject {
|
|||||||
* @return boolean True if the current user can delete this page.
|
* @return boolean True if the current user can delete this page.
|
||||||
*/
|
*/
|
||||||
public function canDelete($member = null) {
|
public function canDelete($member = null) {
|
||||||
if(!isset($member)) $member = Member::currentUser();
|
if(!$member) $member = Member::currentUser();
|
||||||
|
|
||||||
if(Permission::checkMember($member, "ADMIN")) return true;
|
if(Permission::checkMember($member, "ADMIN")) return true;
|
||||||
|
|
||||||
@ -690,7 +690,7 @@ class SiteTree extends DataObject {
|
|||||||
* @return boolean True if the current user can create pages on this class.
|
* @return boolean True if the current user can create pages on this class.
|
||||||
*/
|
*/
|
||||||
public function canCreate($member = null) {
|
public function canCreate($member = null) {
|
||||||
if(!isset($member)) $member = Member::currentUser();
|
if(!$member) $member = Member::currentUser();
|
||||||
|
|
||||||
if(Permission::checkMember($member, "ADMIN")) return true;
|
if(Permission::checkMember($member, "ADMIN")) return true;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user