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

        foreach ($acl->get_granted_sbas() as $databox) {
            $databoxId = $databox->get_sbas_id();
            foreach ($databox->get_meta_structure() as $databox_field) {
                $data = [
                  'name'             => $databox_field->get_name(),
                  'id'               => $databox_field->get_id(),
                  'databox_id'       => $databoxId,
                  'multivalue'       => $databox_field->is_multi(),
                  'indexable'        => $databox_field->is_indexable(),
                  'readonly'         => $databox_field->is_readonly(),
                  'business'         => $databox_field->isBusiness(),
                  'source'           => $databox_field->get_tag()->getTagname(),
                  'labels'           => [
                    'fr' => $databox_field->get_label('fr'),
                    'en' => $databox_field->get_label('en'),
                    'de' => $databox_field->get_label('de'),
                    'nl' => $databox_field->get_label('nl'),
                  ],
                ];
                $ret[] = $data;
            }

            if ($acl->can_see_business_fields($databox) === false) {
                $ret = array_values($this->removeBusinessFields($ret));
            }
        }

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

        foreach ($acl->get_granted_sbas() as $databox) {
            $databoxId = $databox->get_sbas_id();
            foreach ($databox->get_meta_structure() as $databox_field) {
                $data = [
                  'name'             => $databox_field->get_name(),
                  'id'               => $databox_field->get_id(),
                  'databox_id'       => $databoxId,
                  'multivalue'       => $databox_field->is_multi(),
                  'indexable'        => $databox_field->is_indexable(),
                  'readonly'         => $databox_field->is_readonly(),
                  'business'         => $databox_field->isBusiness(),
                  'source'           => $databox_field->get_tag()->getTagname(),
                  'labels'           => [
                    'fr' => $databox_field->get_label('fr'),
                    'en' => $databox_field->get_label('en'),
                    'de' => $databox_field->get_label('de'),
                    'nl' => $databox_field->get_label('nl'),
                  ],
                ];
                $ret[] = $data;
            }

            if ($acl->can_see_business_fields($databox) === false) {
                $ret = array_values($this->removeBusinessFields($ret));
            }
        }

        return $ret;
    }
private function listUserAuthorizedMetadataFields ( User $ user ) { $ acl = $ this -> getAclForUser ( $ user ) ; $ ret = [ ] ; foreach ( $ acl -> get_granted_sbas ( ) as $ databox ) { $ databoxId = $ databox -> get_sbas_id ( ) ; foreach ( $ databox -> get_meta_structure ( ) as $ databox_field ) { $ data = [ 'name' => $ databox_field -> get_name ( ) , 'id' => $ databox_field -> get_id ( ) , 'databox_id' => $ databoxId , 'multivalue' => $ databox_field -> is_multi ( ) , 'indexable' => $ databox_field -> is_indexable ( ) , 'readonly' => $ databox_field -> is_readonly ( ) , 'business' => $ databox_field -> isBusiness ( ) , 'source' => $ databox_field -> get_tag ( ) -> getTagname ( ) , 'labels' => [ 'fr' => $ databox_field -> get_label ( 'fr' ) , 'en' => $ databox_field -> get_label ( 'en' ) , 'de' => $ databox_field -> get_label ( 'de' ) , 'nl' => $ databox_field -> get_label ( 'nl' ) , ] , ] ; $ ret [ ] = $ data ; } if ( $ acl -> can_see_business_fields ( $ databox ) === false ) { $ ret = array_values ( $ this -> removeBusinessFields ( $ ret ) ) ; } } return $ ret ; }
Returns list of Metadata Fields from the databoxes on which the user has rights
@param User $user
@return array
Returns list of Metadata Fields from the databoxes on which the user has rights