mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
31 lines
663 B
PHP
31 lines
663 B
PHP
<?php
|
|
|
|
namespace SilverStripe\CMS\Tests\Controllers;
|
|
|
|
use SilverStripe\CMS\Controllers\SilverStripeNavigatorItem;
|
|
use SilverStripe\Dev\TestOnly;
|
|
use SilverStripe\Security\Permission;
|
|
use SilverStripe\Security\Security;
|
|
|
|
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');
|
|
}
|
|
}
|