Loads the authorization objects configured.

@return array|null The loaded authorization objects, or null when authorize is empty.
@throws \Cake\Core\Exception\Exception
349692
public function constructAuthorize()
    {
        if (empty($this->_config['authorize'])) {
            return null;
        }
        $this->_authorizeObjects = [];
        $authorize = Hash::normalize((array)$this->_config['authorize']);
        $global = [];
        if (isset($authorize[AuthComponent::ALL])) {
            $global = $authorize[AuthComponent::ALL];
            unset($authorize[AuthComponent::ALL]);
        }
        foreach ($authorize as $alias => $config) {
            if (!empty($config['className'])) {
                $class = $config['className'];
                unset($config['className']);
            } else {
                $class = $alias;
            }
            $className = App::className($class, 'Auth', 'Authorize');
            if (!class_exists($className)) {
                throw new Exception(sprintf('Authorization adapter "%s" was not found.', $class));
            }
            if (!method_exists($className, 'authorize')) {
                throw new Exception('Authorization objects must implement an authorize() method.');
            }
            $config = (array)$config + $global;
            $this->_authorizeObjects[$alias] = new $className($this->_registry, $config);
        }

        return $this->_authorizeObjects;
    }
1218796
public function loadAssocRow()
    {
        if ($this->stmt === null) {
            return null;
        }

        return $this->stmt->fetch(\PDO::FETCH_ASSOC);
    }
1250647
protected function getAccessToken()
    {
        switch ($this->grant) {
            case 'provided_token':
                return $this->token;

            case 'client_credentials':
                return $this->getFrameworkBridge()->getClientToken();

            case 'authorization_code':
                $user = $this->getFrameworkBridge()->getCurrentUser();

                if (! $user) {
                    return null;
                }

                return $user->getOAuthToken();

            default:
                throw new \Exception('Unsupported grant type. Check $this->grant.');
        }
    }
1192006
public function authenticate()
    {
        if (empty($this->request)) {
            throw new Exception\RuntimeException(
                'Request and Response objects must be set before calling authenticate()'
            );
        }

        if ($this->request->getUri()->getScheme() != 'https') {

            return new Result(
                Result::FAILURE_UNCATEGORIZED,
                array(),
                array('Http authentication must be over https')
            );
        }

        return parent::authenticate();
    }
1133587
public function getUser()
    {
        if (empty($this->obHelper)) {
            return null;
        }

        $sAuthFacadeClass = $this->obHelper->getAuthFacade();

        return $sAuthFacadeClass::getUser();
    }
923571
public function getAuthorize($alias)
    {
        if (empty($this->_authorizeObjects)) {
            $this->constructAuthorize();
        }

        return isset($this->_authorizeObjects[$alias]) ? $this->_authorizeObjects[$alias] : null;
    }
140061
public function getAuthorisedViewLevels()
	{
		if (is_null($this->authLevels))
		{
			$this->authLevels = array();
		}

		if (empty($this->_authLevels))
		{
			$this->authLevels = Access::getAuthorisedViewLevels($this->get('id'));
		}

		return $this->authLevels;
	}
335795
public function load()
    {
        if (!file_exists($this->file)) {
            return []; // File doesn't exist yet.
        }
        $data = file_get_contents($this->file);
        if (strlen($data) === 0) {
            return [];
        }
        if ($this->isEncrypted()) {
            $data = Crypto::decryptWithPassword($data, $this->key, true);
        }
        return json_decode($data, true);
    }
718908
public function getAuthor()
    {
        $user = null;

        if($this->hasProperty('created_by') && !empty($this->created_by)) {
            $user = $this->getObject('user.provider')->getUser($this->created_by);
        }

        return $user;
    }
500914
public function getAuthority()
    {
        return ($this->getUserInfo() !== '') ? $this->getUserInfo().
        '@' : ''.$this->getHost().($this->getPort() !== '') ? ':'.$this->getPort() : '';
    }
1194206
protected function requestAccessToken() {
        $code = $this->getRequestVar('code');
        if (!empty($code)) {
            $res = $this->sendRequest('POST', $this->getUrl('oauth', 'token'), array(
                'code' => $code,
                'client_id' => $this->getClientId(),
                'client_secret' => $this->getClientSecret(),
                'grant_type' => 'authorization_code',
                'redirect_uri' => $this->redirectUri,
            ));
            $result = $res->getBody();
            if ($result && $result = json_decode($result, true)) {
                if (!empty($result['error'])) {
                    throw new Exception($result['error_description']);
                }

                return $result;
            }
        }
        return null;
    }
371940
public function loadPermissions() {

		$role = $this->role;

		if( isset( $role ) ) {

			$this->permissions = $role->getPermissionsSlugList();
		}
		else {

			throw new ForbiddenHttpException( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NO_ACCESS ) );
		}
	}
1217627
protected function loadTreeFromEvent(): array
    {
        $event = new AddPermissionsEvent($this->permissionKeys);
        $this->dispatcher->dispatch('logauth.add_permissions', $event);

        return $event->getTree();
    }
1246663
protected function getAuthorizationHeader()
    {
        if (empty($this->apiKeyHeader) || empty($this->apiKey)) {
            throw new \Exception('API key is not set.');
        }

        return [$this->apiKeyHeader => $this->apiKey];
    }
678994
public function loadAssoc()
	{
		// Initialise variables
		$return = null;

		// Execute the query
		if (!$this->execute())
		{
			return null;
		}

		// Get the first row from the result set as an associative array
		if ($row = $this->fetchAssoc())
		{
			$return = $row;
		}

		// Free up system resources and return
		$this->freeResult();

		return $return;
	}
231286
protected function fetchData()
    {
        if (empty($this->_items) && $this->type !== null) {
            $authItems = Yii::app()->authManager->getAuthItems($this->type);
            $this->setAuthItems($authItems);
        }

        return $this->_items;
    }
598331
public function getAuthenticationScopes(): array
    {

        // If we don't have any authentication data, then
        // only public calls can be made.
        if (is_null($this->getAuthentication()))
            return ['public'];

        // If there are no scopes that we know of, update them.
        // There will always be at least 1 as we add the internal
        // 'public' scope.
        if (count($this->getAuthentication()->scopes) <= 0)
            $this->setAuthenticationScopes();

        return $this->getAuthentication()->scopes;
    }