You are here

public function LingotekApi::addRoleAssignment in Lingotek Translation 7.4

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::addRoleAssignment()
  2. 7.2 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::addRoleAssignment()
  3. 7.3 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::addRoleAssignment()
  4. 7.5 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::addRoleAssignment()
  5. 7.6 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::addRoleAssignment()

Assigns a role to a user. (Must be done by an community admin) Returns TRUE or FALSE

1 call to LingotekApi::addRoleAssignment()
LingotekApi::checkUserWorkbenchLinkPermissions in lib/Drupal/lingotek/LingotekApi.php
Configures the Lingotek community to allow the local Drupal user to use the Workbench.

File

lib/Drupal/lingotek/LingotekApi.php, line 648
Defines Drupal\lingotek\LingotekApi

Class

LingotekApi
@file Defines Drupal\lingotek\LingotekApi

Code

public function addRoleAssignment($role, $userId) {
  $result = FALSE;
  if (isset($role) && isset($userId)) {
    $parameters = array(
      'role' => $role,
      'clientId' => $userId,
    );
    if ($output = $this
      ->request('addRoleAssignment', $parameters)) {
      if ($output->results == 'success') {
        $result = TRUE;
      }
    }
  }
  return $result;
}