agave-metadata/metadata-core/src/main/java/org/iplantc/service/metadata/model/MetadataAssociationList.java
/**
     * Validates that a given uuid is valid and that the current user has the
     * proper permissions to access it.
     * 
     * @param uuid the uuid to check
     * @return a reference object to the uuid
     * @throws MetadataAssociationException if unable to resolve the associatedId
     * @throws PermissionException if user does not have permission to view the associatedId
     */
Validates that a given uuid is valid and that the current user has the
proper permissions to access it.

@param uuid the uuid to check
@return a reference object to the uuid
@throws MetadataAssociationException if unable to resolve the associatedId
@throws PermissionException if user does not have permission to view the associatedId
Validates that a given uuid is valid and that the current user has the proper permissions to access it . @param uuid the uuid to check @return a reference object to the uuid @throws MetadataAssociationException if unable to resolve the associatedId @throws PermissionException if user does not have permission to view the associatedId
@SuppressWarnings("unused")
    private AssociatedReference checkForValidAssociationUuid(String uuid) throws MetadataAssociationException, PermissionException {
        if (StringUtils.isEmpty(uuid)) {
            throw new MetadataAssociationException("Associated UUID cannot be empty");
        } 
        else 
        {
            AgaveUUID associationUuid;
            try {
                associationUuid = new AgaveUUID(uuid);
                if (UUIDType.METADATA == associationUuid.getResourceType() || UUIDType.SCHEMA == associationUuid.getResourceType()) {
                        String url = TenancyHelper.resolveURLToCurrentTenant(Settings.IPLANT_METADATA_SERVICE + "data/" + uuid);
                        return new AssociatedReference(associationUuid, url);
                } else {
                    String url = associationUuid.getObjectReference();
                    return new AssociatedReference(associationUuid, url);
                }
            }
            catch (UUIDException e1) {
                throw new MetadataAssociationException("No associated resource found with uuid " + uuid);
            }
            catch (Exception e) {
                throw new MetadataAssociationException("Unable to resolve associated resource uuid " + uuid, e);
            }
        }
    }
@ SuppressWarnings ( "unused" ) private AssociatedReference checkForValidAssociationUuid ( String uuid ) throws MetadataAssociationException , PermissionException { if ( StringUtils . isEmpty ( uuid ) ) { throw new MetadataAssociationException ( "Associated UUID cannot be empty" ) ; } else { AgaveUUID associationUuid ; try { associationUuid = new AgaveUUID ( uuid ) ; if ( UUIDType . METADATA == associationUuid . getResourceType ( ) || UUIDType . SCHEMA == associationUuid . getResourceType ( ) ) { String url = TenancyHelper . resolveURLToCurrentTenant ( Settings . IPLANT_METADATA_SERVICE + "data/" + uuid ) ; return new AssociatedReference ( associationUuid , url ) ; } else { String url = associationUuid . getObjectReference ( ) ; return new AssociatedReference ( associationUuid , url ) ; } } catch ( UUIDException e1 ) { throw new MetadataAssociationException ( "No associated resource found with uuid " + uuid ) ; } catch ( Exception e ) { throw new MetadataAssociationException ( "Unable to resolve associated resource uuid " + uuid , e ) ; } } }
Validates that a given uuid is valid and that the current user has the
 proper permissions to access it.
Validates that a given uuid is valid and that the current user has the proper permissions to access it .
// check that the object reference resolves //                    if (false) { //                        throw new PermissionException("User does not permission to reference this resource."); //                    } //            catch (PermissionException e) { //                throw e; //            }