You are here

public function AuthorizationController::setIndividualProfile in Authorization 8

Process a specific profile.

Saves the user account.

Parameters

string|int $profile_id: Authorization profile to act upon.

1 call to AuthorizationController::setIndividualProfile()
AuthorizationController::setAllProfiles in src/AuthorizationController.php
Fetch and process all available profiles.

File

src/AuthorizationController.php, line 80

Class

AuthorizationController
Authorization controller.

Namespace

Drupal\authorization

Code

public function setIndividualProfile($profile_id) : void {

  /** @var \Drupal\authorization\Entity\AuthorizationProfile $profile */
  $profile = $this->entityTypeManager
    ->getStorage('authorization_profile')
    ->load($profile_id);
  if ($profile) {
    $this
      ->processAuthorizations($profile, TRUE);
  }
  else {
    $this->logger
      ->error('Profile @profile could not be loaded.', [
      '@profile' => $profile_id,
    ]);
  }
}