You are here

public function Scope::isDefault in OAuth2 Server 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/Scope.php \Drupal\oauth2_server\Entity\Scope::isDefault()

Returns whether the scope is the default server scope.

Return value

bool TRUE or FALSE

Overrides ScopeInterface::isDefault

File

src/Entity/Scope.php, line 121

Class

Scope
Defines the OAuth2 scope entity.

Namespace

Drupal\oauth2_server\Entity

Code

public function isDefault() {
  $server = $this
    ->getServer();
  if (!empty($this->scope_id) && $server->settings['default_scope'] == $this
    ->id()) {
    return TRUE;
  }
  return FALSE;
}