mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-28 21:46:10 +02:00
70 lines
1.3 KiB
PHP
70 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace SilverStripe\Security\Tests\InheritedPermissionsTest;
|
|
|
|
use SilverStripe\Security\Member;
|
|
use SilverStripe\Security\DefaultPermissionChecker;
|
|
|
|
class TestDefaultPermissionChecker implements DefaultPermissionChecker
|
|
{
|
|
protected $canEdit = true;
|
|
|
|
protected $canView = true;
|
|
|
|
/**
|
|
* Can root be edited?
|
|
*
|
|
* @param Member $member
|
|
* @return bool
|
|
*/
|
|
public function canEdit(Member $member = null)
|
|
{
|
|
return $this->canEdit;
|
|
}
|
|
|
|
/**
|
|
* Can root be viewed?
|
|
*
|
|
* @param Member $member
|
|
* @return bool
|
|
*/
|
|
public function canView(Member $member = null)
|
|
{
|
|
return $this->canView;
|
|
}
|
|
|
|
/**
|
|
* Can root be deleted?
|
|
*
|
|
* @param Member $member
|
|
* @return bool
|
|
*/
|
|
public function canDelete(Member $member = null)
|
|
{
|
|
return $this->canEdit;
|
|
}
|
|
|
|
/**
|
|
* Can root objects be created?
|
|
*
|
|
* @param Member $member
|
|
* @return bool
|
|
*/
|
|
public function canCreate(Member $member = null)
|
|
{
|
|
return $this->canEdit;
|
|
}
|
|
|
|
public function setCanEdit($canEdit)
|
|
{
|
|
$this->canEdit = $canEdit;
|
|
return $this;
|
|
}
|
|
|
|
public function setCanView($canView)
|
|
{
|
|
$this->canView = $canView;
|
|
return $this;
|
|
}
|
|
}
|