function authorize_access_allowed in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/authorize.php \authorize_access_allowed()
Determines if the current user is allowed to run authorize.php.
The killswitch in settings.php overrides all else, otherwise, the user must have access to the 'administer software updates' permission.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The incoming request.
Return value
bool TRUE if the current user can run authorize.php, and FALSE if not.
1 call to authorize_access_allowed()
- authorize.php in core/
authorize.php - Administrative script for running authorized file operations.
File
- core/
authorize.php, line 56 - Administrative script for running authorized file operations.
Code
function authorize_access_allowed(Request $request) {
$account = \Drupal::service('authentication')
->authenticate($request);
if ($account) {
\Drupal::currentUser()
->setAccount($account);
}
return Settings::get('allow_authorize_operations', TRUE) && \Drupal::currentUser()
->hasPermission('administer software updates');
}