Changeset 5938 for ComponentRegistry


Ignore:
Timestamp:
01/21/15 16:09:31 (9 years ago)
Author:
Twan Goosen
Message:

Feedback improvement: the appropriate error is now sent to the user when they try to publish a component that uses (group) private components - rather than a 500 server error
Refs #720

Location:
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/ComponentRegistryRestService.java

    r5921 r5938  
    691691            Principal principal = checkAndGetUserPrincipal();
    692692            ComponentRegistry registry = this.getBaseRegistry();
     693            registry.setRegistrySpace(RegistrySpace.PUBLISHED);
    693694            ProfileDescription desc = registry.getProfileDescriptionAccessControlled(profileId);
    694695            if (desc != null) {
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/MDValidator.java

    r5923 r5938  
    170170                };
    171171                // a private component for a private registry is available only if its owner is the owner of the resgitry
    172                 if (registry.getRegistrySpace().equals(RegistrySpace.PRIVATE)) {
     172                if (RegistrySpace.PRIVATE.equals(registry.getRegistrySpace())) {
    173173                    if(registry.canCurrentUserAccessDescription(componentId)) {
    174174                        return;
     
    178178
    179179                } else { // a private component in a group registry is availabe only if it belongs to the group
    180                     if (registry.getRegistrySpace().equals(RegistrySpace.GROUP)) {
     180                    if (RegistrySpace.GROUP.equals(registry.getRegistrySpace())) {
    181181                        if (registry.getGroupId() == null) {
    182182                            errorMessages.add(COMPONENT_REGISTRY_EXCEPTION_ERROR + "in the group space, the group id is null");
Note: See TracChangeset for help on using the changeset viewer.