Ignore:
Timestamp:
08/21/14 15:24:24 (10 years ago)
Author:
Twan Goosen
Message:

Newly created collection are always private. Updated protocol description to reflect this.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistry.java

    r5543 r5591  
    102102    }
    103103
     104    /**
     105     * Will store the specified collection; it will also set the owner according
     106     * to the specified principal and set its state to
     107     * {@link VirtualCollection.State#PRIVATE}
     108     *
     109     * @param principal owner principal
     110     * @param vc collection to store
     111     * @return identifier of the persisted collection
     112     * @throws VirtualCollectionRegistryException
     113     */
    104114    public long createVirtualCollection(Principal principal,
    105115            VirtualCollection vc) throws VirtualCollectionRegistryException {
     
    124134                em.persist(user);
    125135            }
     136            vc.setOwner(user);
     137
     138            // force new collection to be private
     139            vc.setState(VirtualCollection.State.PRIVATE);
    126140
    127141            // store virtual collection
    128             vc.setOwner(user);
    129142            logger.debug("persisting new virtual collection", vc.getId());
    130143            em.persist(vc);
     
    685698        });
    686699    }
    687    
     700
    688701    private boolean isAllowedToModify(Principal principal, VirtualCollection c) {
    689702        // admin and owner are allowed to modify collections
Note: See TracChangeset for help on using the changeset viewer.