private function listUserAuthorizedSubdefs(User $user)
    {
        $acl = $this->getAclForUser($user);
        $ret = [];

        foreach ($acl->get_granted_sbas() as $databox) {
            $databoxId = $databox->get_sbas_id();
            $subdefs = $databox->get_subdef_structure();
            foreach ($subdefs as $subGroup) {
                foreach ($subGroup->getIterator() as $sub) {
                    $opt = [];
                    $data = [
                      'name'             => $sub->get_name(),
                      'databox_id'       => $databoxId,
                      'class'            => $sub->get_class(),
                      'preset'           => $sub->get_preset(),
                      'downloadable'     => $sub->isDownloadable(),
                      'devices'          => $sub->getDevices(),
                      'labels'           => [
                        'fr' => $sub->get_label('fr'),
                        'en' => $sub->get_label('en'),
                        'de' => $sub->get_label('de'),
                        'nl' => $sub->get_label('nl'),
                      ],
                    ];
                    $options = $sub->getOptions();
                    foreach ($options as $option) {
                        $opt[$option->getName()] = $option->getValue();
                    }
                    $data['options'] = $opt;
                    $ret[$subGroup->getName()][$sub->get_name()] = $data;
                }
            }
        }

        return $ret;
    }
private function listUserAuthorizedSubdefs(User $user)
    {
        $acl = $this->getAclForUser($user);
        $ret = [];

        foreach ($acl->get_granted_sbas() as $databox) {
            $databoxId = $databox->get_sbas_id();
            $subdefs = $databox->get_subdef_structure();
            foreach ($subdefs as $subGroup) {
                foreach ($subGroup->getIterator() as $sub) {
                    $opt = [];
                    $data = [
                      'name'             => $sub->get_name(),
                      'databox_id'       => $databoxId,
                      'class'            => $sub->get_class(),
                      'preset'           => $sub->get_preset(),
                      'downloadable'     => $sub->isDownloadable(),
                      'devices'          => $sub->getDevices(),
                      'labels'           => [
                        'fr' => $sub->get_label('fr'),
                        'en' => $sub->get_label('en'),
                        'de' => $sub->get_label('de'),
                        'nl' => $sub->get_label('nl'),
                      ],
                    ];
                    $options = $sub->getOptions();
                    foreach ($options as $option) {
                        $opt[$option->getName()] = $option->getValue();
                    }
                    $data['options'] = $opt;
                    $ret[$subGroup->getName()][$sub->get_name()] = $data;
                }
            }
        }

        return $ret;
    }
private function listUserAuthorizedSubdefs ( User $ user ) { $ acl = $ this -> getAclForUser ( $ user ) ; $ ret = [ ] ; foreach ( $ acl -> get_granted_sbas ( ) as $ databox ) { $ databoxId = $ databox -> get_sbas_id ( ) ; $ subdefs = $ databox -> get_subdef_structure ( ) ; foreach ( $ subdefs as $ subGroup ) { foreach ( $ subGroup -> getIterator ( ) as $ sub ) { $ opt = [ ] ; $ data = [ 'name' => $ sub -> get_name ( ) , 'databox_id' => $ databoxId , 'class' => $ sub -> get_class ( ) , 'preset' => $ sub -> get_preset ( ) , 'downloadable' => $ sub -> isDownloadable ( ) , 'devices' => $ sub -> getDevices ( ) , 'labels' => [ 'fr' => $ sub -> get_label ( 'fr' ) , 'en' => $ sub -> get_label ( 'en' ) , 'de' => $ sub -> get_label ( 'de' ) , 'nl' => $ sub -> get_label ( 'nl' ) , ] , ] ; $ options = $ sub -> getOptions ( ) ; foreach ( $ options as $ option ) { $ opt [ $ option -> getName ( ) ] = $ option -> getValue ( ) ; } $ data [ 'options' ] = $ opt ; $ ret [ $ subGroup -> getName ( ) ] [ $ sub -> get_name ( ) ] = $ data ; } } } return $ ret ; }
Returns list of sub-definitions from the databoxes on which the user has rights
@param User $user
@return array
Returns list of sub - definitions from the databoxes on which the user has rights