Load list current acl.

@return array
424991
public function loadListCurrentAcl(): array
    {
        $path = $this->getPathListCurrentAcl();
        if (file_exists($path)) {
            return Neon::decode(file_get_contents($path));
        }
        return [];
    }
173592
public function acls()
    {
        if (is_null($this->aclRequests)) {
            $this->aclRequests = new AclRequests($this->client);
        }

        return $this->aclRequests;
    }
62049
protected function getCollIds(\ACL $acl, $baseIds)
    {
        $ret = [];
        /** @var \collection $collection */
        foreach($acl->get_granted_base([\ACL::CANREPORT]) as $collection) {
            if($collection->get_sbas_id() != $this->databox->get_sbas_id()) {
                continue;
            }
            if(!is_null($baseIds) && !in_array($collection->get_base_id(), $baseIds)) {
                continue;
            }
            $ret[] = $this->databox->get_connection()->quote($collection->get_coll_id());
        }

        return $ret;
    }
512389
private function getPathListCurrentAcl(): string
    {
        return sprintf(self::PATH_LIST_CURRENT_ACL, $this->appDir, explode('\\', get_class($this))[3]);
    }
355912
private function getAuthorListFrom()
    {
        $filePath = $this->getFilePathCollection($this->currentPath);

        $authors = [];
        foreach ((array) $filePath['commits'] as $commit) {
            if ($this->isMergeCommit($commit)
                || isset($authors[\md5($commit['name'])])
            ) {
                continue;
            }

            $authors[\md5($commit['name'])] = $commit;
        }

        if (isset($filePath['pathHistory'])) {
            foreach ((array) $filePath['pathHistory'] as $pathHistory) {
                foreach ((array) $pathHistory['commits'] as $commitHistory) {
                    if ($this->isMergeCommit($commitHistory)
                        || isset($authors[\md5($commitHistory['name'])])
                    ) {
                        continue;
                    }

                    $authors[\md5($commitHistory['name'])] = $commitHistory;
                }
            }
        }

        return $authors;
    }
1136894
public function getAccessTokenRules()
    {
        if (!is_string($this->accessTokenAttribute) || empty($this->accessTokenAttribute)) {
            return [];
        }
        if (empty($this->accessTokenRules)) {
            $this->accessTokenRules = [
                [[$this->accessTokenAttribute], 'required'],
                [[$this->accessTokenAttribute], 'string', 'max' => 40],
            ];
        }
        return $this->accessTokenRules;
    }
971042
protected function loadRelated(): array
    {
        $innerKey = $this->parent->getField($this->key(Record::INNER_KEY));
        if (empty($innerKey)) {
            return [];
        }

        //Work with pre-build query
        $query = $this->createQuery($innerKey);

        //Use custom node to parse data
        $node = new PivotedRootNode(
            $this->schema[Record::RELATION_COLUMNS],
            $this->schema[Record::PIVOT_COLUMNS],
            $this->schema[Record::OUTER_KEY],
            $this->schema[Record::THOUGHT_INNER_KEY],
            $this->schema[Record::THOUGHT_OUTER_KEY]
        );

        $iterator = $query->getIterator();
        foreach ($iterator as $row) {
            //Time to parse some data
            $node->parseRow(0, $row);
        }

        //Memory free
        $iterator->close();

        return $node->getResult();
    }
1049471
private function getGrantedCollections(\ACL $acl)
    {
        $collections = [];

        foreach ($acl->get_granted_sbas() as $databox) {
            $sbasId = $databox->get_sbas_id();
            foreach ($acl->get_granted_base([\ACL::CANADDRECORD], [$sbasId]) as $collection) {
                $databox = $collection->get_databox();
                if (!isset($collections[$sbasId])) {
                    $collections[$databox->get_sbas_id()] = [
                        'databox'             => $databox,
                        'databox_collections' => []
                    ];
                }
                $collections[$databox->get_sbas_id()]['databox_collections'][] = $collection;
                /** @var DisplaySettingService $settings */
                $settings = $this->app['settings'];
                $userOrderSetting = $settings->getUserSetting($this->app->getAuthenticatedUser(), 'order_collection_by');
                // a temporary array to sort the collections
                $aName = [];
                list($ukey, $uorder) = ["order", SORT_ASC];     // default ORDER_BY_ADMIN
                switch ($userOrderSetting) {
                    case $settings::ORDER_ALPHA_ASC :
                        list($ukey, $uorder) = ["name", SORT_ASC];
                        break;
                    case $settings::ORDER_ALPHA_DESC :
                        list($ukey, $uorder) = ["name", SORT_DESC];
                        break;
                }
                foreach ($collections[$databox->get_sbas_id()]['databox_collections'] as $key => $row) {
                    if ($ukey == "order") {
                        $aName[$key] = $row->get_ord();
                    }
                    else {
                        $aName[$key] = $row->get_name();
                    }
                }
                // sort the collections
                array_multisort($aName, $uorder, SORT_REGULAR, $collections[$databox->get_sbas_id()]['databox_collections']);
            }
        }
        return $collections;

    }
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);
    }
1176800
public function getAcl()
    {
        if ($this->_acl === null) {
            $serviceLocator = $this->getServiceLocator();
            // try service locator first
            if ($serviceLocator->has('Acl')) {
                $this->setAcl($serviceLocator->get('Acl'));
            // try default acl object
            } elseif (self::$_defaultAcl !== null) {
                return self::$_defaultAcl;

            }
        }

        return $this->_acl;
    }
738765
protected function getPrivileges()
    {
        if (!$this->privileges) {
            $privileges = [];

            $allExisting = $this->getUsedPrivileges();

            foreach ($this->acl->getPrivilegeRoles() as $privilege => $roles) {
                $privileges[$privilege]['privilege'] = $privilege;
                $privileges[$privilege]['menu'] = isset($allExisting[$privilege]) ? $allExisting[$privilege] : null;
                $privileges[$privilege]['allowed'] = $roles[\Zend_Acl::TYPE_ALLOW] ? implode(', ', $roles[\Zend_Acl::TYPE_ALLOW]) : null;
                $privileges[$privilege]['denied'] = $roles[\Zend_Acl::TYPE_DENY] ? implode(', ', $roles[\Zend_Acl::TYPE_DENY]) : null;
            }

            // Add unassigned rights to the array too

            $unassigned = array_diff_key($allExisting, $privileges);
            $nonexistent = array_diff_key($privileges, $allExisting);
            unset($nonexistent['pr.nologin']);
            unset($nonexistent['pr.islogin']);
            ksort($nonexistent);

            foreach ($unassigned as $privilege => $description) {
                $privileges[$privilege] = array(
                    'privilege' => $privilege,
                    'menu' => isset($allExisting[$privilege]) ? $allExisting[$privilege] : null,
                    'allowed' => null,
                    'denied' => null
                );
            }
            ksort($privileges);

            $this->setNonExistent($nonexistent);

            $this->privileges = $privileges;
        }
        return $this->privileges;
    }
248059
private function getRequestedRoles()
    {
        $rules = $this->config->get('Rules', false);
        if (!$rules) {
            return [];
        }

        // see which of the rules matches the path and extract the requested roles for access
        $returnRoles = [];
        foreach ($rules as $r) {
            $path = $r->get('Path', false);
            if ($path && $this->testPath($path)) {
                $roles = $r->get('Roles', []);
                if ($this->isString($roles)) {
                    $roles = (array)$roles;
                } else {
                    $roles = $roles->toArray();
                }

                // covert the role names to Role instances
                foreach ($roles as $role) {
                    $returnRoles[] = new Role($role);
                }

                return $returnRoles;
            }
        }

        return [];
    }
839481
public List<Acl> listAcls() {
    // [START listAcls]
    List<Acl> acls = bucket.listAcls();
    for (Acl acl : acls) {
      // do something with ACL entry
    }
    // [END listAcls]
    return acls;
  }
265355
protected function loadAccessLevels()
    {
        $accessLevels = $this->accessLevelsObjectBackend->loadObject();
        if (!is_array($accessLevels)) {
            $accessLevels = array();
        }
        
        $this->accessLevels = $accessLevels;
    }
787542
private function loadFiles(): array
    {
        $items = [];
        if (!is_dir($this->path)) {
            return $items;
        }

        $entries = Finder::create()->files()->name('*.php')->in($this->path);

        // Load files.
        foreach ($entries as $entry) {
            $basename = call_user_func([$entry, 'getBasename']);

            if ($this->isEnvironmentFilename($basename)) {
                // Do not process this file. It will be handled later.
                continue;
            }

            $pathRelative = call_user_func([$entry, 'getRelativePath']);
            $configKey = rtrim($basename, '.php');

            // Load main config-file.
            $this->loadFile($items, $this->path, $pathRelative, $configKey);

            // Load environment config-file.
            $this->loadFile($items, $this->path, $pathRelative, $configKey, $this->environment);
        }

        return $items;
    }
121929
public function load()
    {
        $data = [];

        if (is_file($this->filePath)) {
            $data = json_decode(file_get_contents($this->filePath), true);
        }

        return $data;
    }
1141765
private function getKeysFromAcl() {
        $keys = [];
        foreach ($this->accessList as $access) {
            $keys[$access['publicKey']] = $access['privateKey'];
        }

        return $keys;
    }