本文整理匯總了PHP中Symfony\Bundle\FrameworkBundle\Controller\Controller::isGranted方法的典型用法代碼示例。如果您正苦於以下問題:PHP Controller::isGranted方法的具體用法?PHP Controller::isGranted怎麽用?PHP Controller::isGranted使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Bundle\FrameworkBundle\Controller\Controller
的用法示例。
在下文中一共展示了Controller::isGranted方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isGranted
public function isGranted($attributes, $object = null)
{
return parent::isGranted($attributes, $object);
}
示例2: granted
/**
* Same as isGranted() but throw exception if it is not instead of return false.
*
* @param string $attributes
* @param mixed $object
*
* @return boolean
*/
protected function granted($attributes, $object = null, $message = 'Permission denied')
{
if (false === parent::isGranted($attributes, $object)) {
throw new InsufficientAuthenticationException($message);
}
return true;
}
示例3: isGranted
/**
* {@inheritdoc}
*
* Symfony <2.6 BC. To be removed.
*/
protected function isGranted($attributes, $object = null)
{
if (method_exists('Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller', 'isGranted')) {
return parent::isGranted($attributes, $object);
}
return $this->get('security.context')->isGranted($attributes, $object);
}
示例4: isGranted
/**
* {@inheritdoc}
*
* @return boolean
*/
protected function isGranted($attributes, $object = null)
{
if ($this->getParameter('madrak_io_easy_admin.grants.check') === true) {
return parent::isGranted($attributes, $object);
}
return true;
}