You are here

class CertificateMappingAccessControlHandler in Certificate 4.x

Hierarchy

Expanded class hierarchy of CertificateMappingAccessControlHandler

File

src/Access/CertificateMappingAccessControlHandler.php, line 9

Namespace

Drupal\certificate\Access
View source
class CertificateMappingAccessControlHandler extends UncacheableEntityAccessControlHandler {
  protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
    if ($account
      ->hasPermission('assign certificates')) {
      return \Drupal\Core\Access\AccessResultAllowed::allowed();
    }
    return parent::checkCreateAccess($account, $context, $entity_bundle);
  }
  function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
    if ($account
      ->hasPermission('assign certificates')) {
      return \Drupal\Core\Access\AccessResultAllowed::allowed();
    }
    return parent::checkAccess($entity, $operation, $account);
  }

}

Members