You are here

class SocialEventInvitesAccess in Open Social 10.1.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/modules/social_event_invite/src/Access/SocialEventInvitesAccess.php \Drupal\social_event_invite\Access\SocialEventInvitesAccess
  2. 10.3.x modules/social_features/social_event/modules/social_event_invite/src/Access/SocialEventInvitesAccess.php \Drupal\social_event_invite\Access\SocialEventInvitesAccess
  3. 10.0.x modules/social_features/social_event/modules/social_event_invite/src/Access/SocialEventInvitesAccess.php \Drupal\social_event_invite\Access\SocialEventInvitesAccess
  4. 10.2.x modules/social_features/social_event/modules/social_event_invite/src/Access/SocialEventInvitesAccess.php \Drupal\social_event_invite\Access\SocialEventInvitesAccess

Class SocialEventInvitesAccess.

@package Drupal\social_event_invite\Access

Hierarchy

Expanded class hierarchy of SocialEventInvitesAccess

1 string reference to 'SocialEventInvitesAccess'
social_event_invite.services.yml in modules/social_features/social_event/modules/social_event_invite/social_event_invite.services.yml
modules/social_features/social_event/modules/social_event_invite/social_event_invite.services.yml
1 service uses SocialEventInvitesAccess
social_event_invite.access in modules/social_features/social_event/modules/social_event_invite/social_event_invite.services.yml
Drupal\social_event_invite\Access\SocialEventInvitesAccess

File

modules/social_features/social_event/modules/social_event_invite/src/Access/SocialEventInvitesAccess.php, line 15

Namespace

Drupal\social_event_invite\Access
View source
class SocialEventInvitesAccess {

  /**
   * The event invite access helper.
   *
   * @var \Drupal\social_event_invite\SocialEventInviteAccessHelper
   */
  protected $accessHelper;

  /**
   * EventInvitesAccess constructor.
   *
   * @param \Drupal\social_event_invite\SocialEventInviteAccessHelper $accessHelper
   *   The event invite access helper.
   */
  public function __construct(SocialEventInviteAccessHelper $accessHelper) {
    $this->accessHelper = $accessHelper;
  }

  /**
   * Custom access check on the invite features on events.
   *
   * @return \Drupal\Core\Access\AccessResult
   *   Returns the result of the access helper.
   *
   * @see \Drupal\social_event_invite\SocialEventInviteAccessHelper::eventFeatureAccess()
   */
  public function eventFeatureAccess() {
    try {
      return $this->accessHelper
        ->eventFeatureAccess();
    } catch (InvalidPluginDefinitionException $e) {
      return AccessResult::neutral();
    } catch (PluginNotFoundException $e) {
      return AccessResult::neutral();
    }
  }

  /**
   * Custom access check for the user invite overview.
   *
   * @return \Drupal\Core\Access\AccessResult
   *   Returns the result of the access helper.
   *
   * @see \Drupal\social_event_invite\SocialEventInviteAccessHelper::userInviteAccess()
   */
  public function userInviteAccess() {
    return $this->accessHelper
      ->userInviteAccess();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SocialEventInvitesAccess::$accessHelper protected property The event invite access helper.
SocialEventInvitesAccess::eventFeatureAccess public function Custom access check on the invite features on events.
SocialEventInvitesAccess::userInviteAccess public function Custom access check for the user invite overview.
SocialEventInvitesAccess::__construct public function EventInvitesAccess constructor.