Project

General

Profile

« Previous | Next » 

Revision 6390

check with the CN if replication is allowed for the object in question for getReplica()

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
68 68
import org.dataone.service.types.v1.NodeReference;
69 69
import org.dataone.service.types.v1.NodeState;
70 70
import org.dataone.service.types.v1.NodeType;
71
import org.dataone.service.types.v1.ObjectFormat;
72 71
import org.dataone.service.types.v1.ObjectFormatIdentifier;
73 72
import org.dataone.service.types.v1.ObjectList;
74 73
import org.dataone.service.types.v1.Permission;
......
983 982
	                         " does not exist at this node.");
984 983
	    }
985 984
	    
986
	    // check for authorization
987
	    allowed = isAuthorized(session, pid, Permission.READ);
985
	    Node node = this.getCapabilities();
986
	    Subject targetNodeSubject = node.getSubject(0);
988 987
	    
988
		// check for authorization to replicate
989
	    allowed = D1Client.getCN().isReplicationAuthorized(session, targetNodeSubject , pid, Permission.EXECUTE);
990
	    
989 991
	    // if the person is authorized, perform the read
990 992
	    if (allowed) {
991 993
	      try {
......
1006 1008
	    }
1007 1009
	    
1008 1010
		// log the replica event
1009
	    String principal = Constants.PUBLIC_SUBJECT;
1011
	    String principal = null;
1010 1012
	    if (session.getSubject() != null) {
1011 1013
	    	principal = session.getSubject().getValue();
1012 1014
	    }

Also available in: Unified diff