silverstripe-cms/tests/controller/SilverStripeNavigatorTest_ProtectedTestItem.php
Damian Mooyman c2c75aa9e3
Fix and upgrade all tests
Fix link tracking
2017-06-21 16:29:40 +12:00

28 lines
615 B
PHP

<?php
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');
}
}