Project

General

Profile

Revision 6649

check obsoletes and obsoletedBy PIDs when updating objects

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
311 311
        allowed = isAuthorized(session, pid, Permission.WRITE);
312 312

  
313 313
        if (allowed) {
314
        	
315
        	// check quality of SM
316
        	if (sysmeta.getObsoletedBy() != null) {
317
        		throw new InvalidSystemMetadata("1300", "Cannot include obsoletedBy when updating object");
318
        	}
319
        	if (sysmeta.getObsoletes() != null && !sysmeta.getObsoletes().getValue().equals(pid.getValue())) {
320
        		throw new InvalidSystemMetadata("1300", "The identifier provided in obsoletes does not match old Identifier");
321
        	}
314 322

  
315 323
            // get the existing system metadata for the object
316 324
            SystemMetadata existingSysMeta = getSystemMetadata(session, pid);

Also available in: Unified diff