geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
426 stars 489 forks source link

AngularJS UI: Create new metadata form display the internal groups for the metadata group owner selection #575

Closed josegar74 closed 9 years ago

josegar74 commented 10 years ago

Internal groups (All, Guest, Intranet) should not be displayed for the metadata group owner selection in the metadata create form.

create_metadata_groups

josegar74 commented 10 years ago

This happens for Administrator users as the service returns all groups for these users.

Delawen commented 9 years ago

Is this a bug or a feature? I wonder....

josegar74 commented 9 years ago

For me is a bug. Users should not create metadata in special groups, at least never has been like this.

josegar74 commented 9 years ago

The "easy" fix is to remove the groups combo directive to avoid rendering the special groups adding this to groupsCombo.hml, see in the following snippet data-ng-if:

   <option data-ng-repeat="g in groups | orderBy:'name'" value="{{g['@id']}}"  data-ng-if="g['@id'] > 1"

This directive is used in these places:

In the 3 first cases makes sense to me to remove the special groups, but not sure in the last case? Any feedback on this would be appreciated

fxprunayre commented 9 years ago

I would suggest to add to the directive an attribute which configure if system groups needs to be in the listed or not (see https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/formfields/FormFieldsDirective.js#L215) and by default not include them ? The info service will take care of returning the groups you want (sounds better than the filter by id).

Also, at the same time, remove "@json" by _content_type=json.

josegar74 commented 9 years ago

I have implemented is a similar way, but just see your comment now.

The special groups are not displayed, except for the directives that seem in 2.10 displays the special groups also.

josegar74 commented 9 years ago

There's already an attribute already to retrieve system groups, but in the case of an administrator user are retrieved in any case.

I guess with the solution applied, can manage both cases better.