2017-06-21 06:29:40 +02:00
|
|
|
<?php
|
2017-08-09 03:25:12 +02:00
|
|
|
|
|
|
|
namespace SilverStripe\CMS\Tests;
|
|
|
|
|
2017-06-21 06:29:40 +02:00
|
|
|
use SilverStripe\CMS\Controllers\SilverStripeNavigatorItem;
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\Security\Permission;
|
|
|
|
use SilverStripe\Security\Security;
|
|
|
|
|
2017-08-09 03:25:12 +02:00
|
|
|
|
|
|
|
|
2017-06-21 06:29:40 +02:00
|
|
|
class SilverStripeNavigatorTest_ProtectedTestItem extends SilverStripeNavigatorItem implements TestOnly
|
|
|
|
{
|
|
|
|
|
|
|
|
public function getTitle()
|
|
|
|
{
|
|
|
|
return self::class;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHTML()
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function canView($member = null)
|
|
|
|
{
|
|
|
|
if (!$member) {
|
|
|
|
$member = Security::getCurrentUser();
|
|
|
|
}
|
|
|
|
return Permission::checkMember($member, 'ADMIN');
|
|
|
|
}
|
|
|
|
}
|