当前位置: 首页>>代码示例>>PHP>>正文


PHP EntityAccessControlHandler::createAccess方法代码示例

本文整理汇总了PHP中Drupal\Core\Entity\EntityAccessControlHandler::createAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityAccessControlHandler::createAccess方法的具体用法?PHP EntityAccessControlHandler::createAccess怎么用?PHP EntityAccessControlHandler::createAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\Core\Entity\EntityAccessControlHandler的用法示例。


在下文中一共展示了EntityAccessControlHandler::createAccess方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createAccess

 /**
  * {@inheritdoc}
  */
 public function createAccess($entity_bundle = NULL, AccountInterface $account = NULL, array $context = [], $return_as_object = FALSE)
 {
     $account = $this->prepareUser($account);
     if ($account->hasPermission('bypass profile access')) {
         $result = AccessResult::allowed()->cachePerPermissions();
         return $return_as_object ? $result : $result->isAllowed();
     }
     $result = parent::createAccess($entity_bundle, $account, $context, TRUE)->cachePerPermissions();
     return $return_as_object ? $result : $result->isAllowed();
 }
开发者ID:augustpascual-mse,项目名称:job-searching-network,代码行数:13,代码来源:ProfileAccessControlHandler.php

示例2: createAccess

 /**
  * {@inheritdoc}
  */
 public function createAccess($entity_bundle = NULL, AccountInterface $account = NULL, array $context = array(), $return_as_object = FALSE)
 {
     $account = $this->prepareUser($account);
     if (!$account->hasPermission('access support tickets')) {
         $result = AccessResult::forbidden()->cachePerPermissions();
         return $return_as_object ? $result : $result->isAllowed();
     }
     $result = parent::createAccess($entity_bundle, $account, $context, TRUE)->cachePerPermissions();
     return $return_as_object ? $result : $result->isAllowed();
 }
开发者ID:justincletus,项目名称:webdrupalpro,代码行数:13,代码来源:SupportTicketAccessControlHandler.php

示例3: createAccess

 /**
  * {@inheritdoc}
  */
 public function createAccess($entity_bundle = NULL, AccountInterface $account = NULL, array $context = array(), $return_as_object = FALSE)
 {
     $account = $this->prepareUser($account);
     // Checks for bypass permission.
     if ($account->hasPermission('bypass eck entity access') && $account) {
         $result = AccessResult::allowed()->cachePerPermissions();
         return $return_as_object ? $result : $result->isAllowed();
     }
     // Check if the user has permission to access eck entities.
     if (!$account->hasPermission('access eck entities')) {
         $result = AccessResult::forbidden()->cachePerPermissions();
         return $return_as_object ? $result : $result->isAllowed();
     }
     $result = parent::createAccess($entity_bundle, $account, $context, TRUE)->cachePerPermissions();
     return $return_as_object ? $result : $result->isAllowed();
 }
开发者ID:jokas,项目名称:d8.dev,代码行数:19,代码来源:EckEntityAccessControlHandler.php

示例4: createAccess

 /**
  * {@inheritdoc}
  */
 public function createAccess($entity_bundle = NULL, AccountInterface $account = NULL, array $context = array(), $return_as_object = FALSE)
 {
     workflow_debug(__FILE__, __FUNCTION__, __LINE__);
     // @todo D8-port: still test this snippet.
     $result = parent::createAccess($entity_bundle, $account, $context, TRUE)->cachePerPermissions();
     return $return_as_object ? $result : $result->isAllowed();
 }
开发者ID:sedurzu,项目名称:ildeposito8,代码行数:10,代码来源:WorkflowAccessControlHandler.php


注:本文中的Drupal\Core\Entity\EntityAccessControlHandler::createAccess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。