You are here

class AccessCheck in Content Planner 8

Class AccessCheck.

@package Drupal\my_module\Access

Hierarchy

Expanded class hierarchy of AccessCheck

File

modules/content_kanban/src/Access/AccessCheck.php, line 14

Namespace

Drupal\content_kanban\Access
View source
class AccessCheck implements AccessInterface {

  /**
   * Check if user can access the Content Kanban.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The the current user.
   *
   * @return \Drupal\Core\Access\AccessResultAllowed|\Drupal\Core\Access\AccessResultForbidden
   *   Returns the access result.
   */
  public function canAccessContentKanban(AccountInterface $account) {
    if ($account
      ->hasPermission('manage own content with content kanban') || $account
      ->hasPermission('manage any content with content kanban')) {
      return AccessResult::allowed();
    }
    return AccessResult::forbidden();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AccessCheck::canAccessContentKanban public function Check if user can access the Content Kanban.