public function InviteAccessController::withdrawInviteAccess in Invite 8
1 string reference to 'InviteAccessController::withdrawInviteAccess'
File
- src/
Controller/ InviteAccessController.php, line 37
Class
- InviteAccessController
- Defines the access control handler for invite routes.
Namespace
Drupal\invite\ControllerCode
public function withdrawInviteAccess(AccountInterface $account) {
$badge_admin = $account
->hasPermission('administer invite settings');
if ($badge_admin) {
return AccessResult::allowed();
}
else {
/** @var \Drupal\invite\InviteInterface $invite */
$invite_from_url = $this->routeMatch
->getParameter('invite');
return AccessResult::allowedIf($account
->id() && $account
->id() == $invite_from_url
->getOwnerId() && $account
->hasPermission('resend own invitations'))
->cachePerPermissions()
->cachePerUser();
}
}