original_string: public function setGlobalAccess($enable, $user = 'current')
      {
          $user = $this->getUser($user);
          if ($user === null) {
              throw new UserMessageException(t('Invalid user'));
          }
          if ($user->getUserID() === USER_SUPER_ID) {
              return;
          }
          $group = $this->groups->getGlobalAdministrators();
          if ($enable) {
              foreach ($this->app->make(LocaleRepository::class)->getApprovedLocales() as $locale) {
                  $this->setLocaleAccess($locale, self::NONE, $user);
              }
              if (!$user->inGroup($group)) {
                  $user->enterGroup($group);
              }
          } else {
              if ($user->inGroup($group)) {
                  $user->exitGroup($group);
              }
          }
      }
code: public function setGlobalAccess($enable, $user = 'current')
      {
          $user = $this->getUser($user);
          if ($user === null) {
              throw new UserMessageException(t('Invalid user'));
          }
          if ($user->getUserID() === USER_SUPER_ID) {
              return;
          }
          $group = $this->groups->getGlobalAdministrators();
          if ($enable) {
              foreach ($this->app->make(LocaleRepository::class)->getApprovedLocales() as $locale) {
                  $this->setLocaleAccess($locale, self::NONE, $user);
              }
              if (!$user->inGroup($group)) {
                  $user->enterGroup($group);
              }
          } else {
              if ($user->inGroup($group)) {
                  $user->exitGroup($group);
              }
          }
      }
code_tokens: public function setGlobalAccess ( $ enable , $ user = 'current' ) { $ user = $ this -> getUser ( $ user ) ; if ( $ user === null ) { throw new UserMessageException ( t ( 'Invalid user' ) ) ; } if ( $ user -> getUserID ( ) === USER_SUPER_ID ) { return ; } $ group = $ this -> groups -> getGlobalAdministrators ( ) ; if ( $ enable ) { foreach ( $ this -> app -> make ( LocaleRepository :: class ) -> getApprovedLocales ( ) as $ locale ) { $ this -> setLocaleAccess ( $ locale , self :: NONE , $ user ) ; } if ( ! $ user -> inGroup ( $ group ) ) { $ user -> enterGroup ( $ group ) ; } } else { if ( $ user -> inGroup ( $ group ) ) { $ user -> exitGroup ( $ group ) ; } } }
docstring: Set or unset global administration access.
  
  @param bool $enable
  @param UserService|int|'current' $user
docstring_tokens: Set or unset global administration access .