public function ProtectedPagesLoginForm::accessProtectedPageLoginScreen in Protected Pages 8
Checks access based permission and protected page id.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
1 string reference to 'ProtectedPagesLoginForm::accessProtectedPageLoginScreen'
File
- src/
Form/ ProtectedPagesLoginForm.php, line 92
Class
- ProtectedPagesLoginForm
- Provides login screen to access protected page.
Namespace
Drupal\protected_pages\FormCode
public function accessProtectedPageLoginScreen() {
$param_protected_page = $this
->getRequest()->query
->get('protected_page');
$param_exists = isset($param_protected_page) && is_numeric($param_protected_page);
return AccessResult::allowedIf(($this->currentUser
->hasPermission('access protected page password screen') || $this->currentUser
->id() == 1) && $param_exists);
}