public function UserEnrollInviteController::access in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/modules/social_event_invite/src/Controller/UserEnrollInviteController.php \Drupal\social_event_invite\Controller\UserEnrollInviteController::access()
- 10.3.x modules/social_features/social_event/modules/social_event_invite/src/Controller/UserEnrollInviteController.php \Drupal\social_event_invite\Controller\UserEnrollInviteController::access()
- 10.1.x modules/social_features/social_event/modules/social_event_invite/src/Controller/UserEnrollInviteController.php \Drupal\social_event_invite\Controller\UserEnrollInviteController::access()
- 10.2.x modules/social_features/social_event/modules/social_event_invite/src/Controller/UserEnrollInviteController.php \Drupal\social_event_invite\Controller\UserEnrollInviteController::access()
Checks access for a specific request.
Parameters
\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
Overrides CancelEnrollInviteController::access
1 string reference to 'UserEnrollInviteController::access'
- social_event_invite.routing.yml in modules/
social_features/ social_event/ modules/ social_event_invite/ social_event_invite.routing.yml - modules/social_features/social_event/modules/social_event_invite/social_event_invite.routing.yml
File
- modules/
social_features/ social_event/ modules/ social_event_invite/ src/ Controller/ UserEnrollInviteController.php, line 106
Class
- UserEnrollInviteController
- Accepts or declines an event enrollment invite.
Namespace
Drupal\social_event_invite\ControllerCode
public function access(AccountInterface $account) {
// Get the parameter from the request that has been done.
$user_parameter = $this->requestStack
->getCurrentRequest()->attributes
->get('user');
// Check if it's the same that is in the current session's account.
if ($account
->id() === $user_parameter) {
return AccessResult::allowed();
}
return AccessResult::neutral();
}