public function get_granted_base(Array $rights = [], array $sbas_ids = null)
    {
        $this->load_rights_bas();
        $ret = [];

        foreach ($this->app->getDataboxes() as $databox) {
            if ($sbas_ids && !in_array($databox->get_sbas_id(), $sbas_ids)) {
                continue;
            }

            foreach ($databox->get_collections() as $collection) {
                $continue = false;

                if (!array_key_exists($collection->get_base_id(), $this->_rights_bas)) {
                    continue;
                }

                $base_id = $collection->get_base_id();

                foreach ($rights as $right) {
                    if (!$this->has_right_on_base($base_id, $right)) {
                        $continue = true;
                        break;
                    }
                }
                if ($continue || $this->is_limited($base_id)) {
                    continue;
                }

                $ret[$base_id] = $collection;
            }
        }

        return $ret;
    }
public function get_granted_base(Array $rights = [], array $sbas_ids = null)
    {
        $this->load_rights_bas();
        $ret = [];

        foreach ($this->app->getDataboxes() as $databox) {
            if ($sbas_ids && !in_array($databox->get_sbas_id(), $sbas_ids)) {
                continue;
            }

            foreach ($databox->get_collections() as $collection) {
                $continue = false;

                if (!array_key_exists($collection->get_base_id(), $this->_rights_bas)) {
                    continue;
                }

                $base_id = $collection->get_base_id();

                foreach ($rights as $right) {
                    if (!$this->has_right_on_base($base_id, $right)) {
                        $continue = true;
                        break;
                    }
                }
                if ($continue || $this->is_limited($base_id)) {
                    continue;
                }

                $ret[$base_id] = $collection;
            }
        }

        return $ret;
    }
public function get_granted_base ( Array $ rights = [ ] , array $ sbas_ids = null ) { $ this -> load_rights_bas ( ) ; $ ret = [ ] ; foreach ( $ this -> app -> getDataboxes ( ) as $ databox ) { if ( $ sbas_ids && ! in_array ( $ databox -> get_sbas_id ( ) , $ sbas_ids ) ) { continue ; } foreach ( $ databox -> get_collections ( ) as $ collection ) { $ continue = false ; if ( ! array_key_exists ( $ collection -> get_base_id ( ) , $ this -> _rights_bas ) ) { continue ; } $ base_id = $ collection -> get_base_id ( ) ; foreach ( $ rights as $ right ) { if ( ! $ this -> has_right_on_base ( $ base_id , $ right ) ) { $ continue = true ; break ; } } if ( $ continue || $ this -> is_limited ( $ base_id ) ) { continue ; } $ ret [ $ base_id ] = $ collection ; } } return $ ret ; }
Return an array of base_id which are granted, with
optionnal filter by rights

@param  array      $rights
@param  array|null $sbas_ids Optionnal sbas_id to restrict the query on
@return collection[] An array of collection
Return an array of base_id which are granted with optionnal filter by rights