Project

General

Profile

« Previous | Next » 

Revision 6522

do not allow system metadata to have obsoletes or obsoletedBy fields when calling the create() method -- these are only allowed for updates so that we do not subvert object versioning by [un]knowingly submitting system metadata that directs one id to another.

View differences:

src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java
180 180
    	
181 181
    }
182 182
    
183
    // check that we are not attempting to subvert versioning
184
    if (sysmeta.getObsoletes() != null && sysmeta.getObsoletes().getValue() != null) {
185
    	throw new InvalidSystemMetadata("1180", 
186
    			"The supplied system metadata is invalid. " +
187
    			"The obsoletes field cannot have a value when creating entries.");
188
    }
189
    if (sysmeta.getObsoletedBy() != null && sysmeta.getObsoletedBy().getValue() != null) {
190
    	throw new InvalidSystemMetadata("1180", 
191
    			"The supplied system metadata is invalid. " +
192
    			"The obsoletedBy field cannot have a value when creating entries.");
193
	}
194
    
183 195
    // check for permission
184 196
    try {
185 197
      allowed = isAuthorized(session, pid, Permission.WRITE);

Also available in: Unified diff