SocialEventInvitesAccess.php in Open Social 8.9
Same filename and directory in other branches
- 10.3.x modules/social_features/social_event/modules/social_event_invite/src/Access/SocialEventInvitesAccess.php
- 10.0.x modules/social_features/social_event/modules/social_event_invite/src/Access/SocialEventInvitesAccess.php
- 10.1.x modules/social_features/social_event/modules/social_event_invite/src/Access/SocialEventInvitesAccess.php
- 10.2.x modules/social_features/social_event/modules/social_event_invite/src/Access/SocialEventInvitesAccess.php
Namespace
Drupal\social_event_invite\AccessFile
modules/social_features/social_event/modules/social_event_invite/src/Access/SocialEventInvitesAccess.phpView source
<?php
namespace Drupal\social_event_invite\Access;
use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException;
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Core\Access\AccessResult;
use Drupal\social_event_invite\SocialEventInviteAccessHelper;
/**
* Class SocialEventInvitesAccess.
*
* @package Drupal\social_event_invite\Access
*/
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();
}
}
Classes
Name | Description |
---|---|
SocialEventInvitesAccess | Class SocialEventInvitesAccess. |