Revision 6777
Added by ben leinfelder about 13 years ago
src/edu/ucsb/nceas/metacat/restservice/CNResourceHandler.java | ||
---|---|---|
1066 | 1066 |
boolean result = false; |
1067 | 1067 |
Subject targetNodeSubject = new Subject(); |
1068 | 1068 |
String nodeSubject = null; |
1069 |
Permission permission = null; |
|
1070 | 1069 |
String replPermission = null; |
1071 | 1070 |
|
1072 | 1071 |
// get the pid |
... | ... | |
1085 | 1084 |
|
1086 | 1085 |
} |
1087 | 1086 |
|
1088 |
// get the permission |
|
1089 |
try { |
|
1090 |
replPermission = params.get("replicatePermission")[0]; |
|
1091 |
permission = Permission.convert(replPermission); |
|
1087 |
result = CNodeService.getInstance(request).isNodeAuthorized(session, targetNodeSubject, identifier); |
|
1092 | 1088 |
|
1093 |
} catch (NullPointerException e) { |
|
1094 |
String msg = "The 'replicatePermission' must be provided as a parameter and was not."; |
|
1095 |
logMetacat.error(msg); |
|
1096 |
throw new InvalidRequest("4873", msg); |
|
1097 |
|
|
1098 |
} |
|
1099 |
|
|
1100 |
result = CNodeService.getInstance(request).isNodeAuthorized(session, |
|
1101 |
targetNodeSubject, identifier, permission); |
|
1102 |
|
|
1103 | 1089 |
response.setStatus(200); |
1104 | 1090 |
response.setContentType("text/xml"); |
1105 | 1091 |
return result; |
src/edu/ucsb/nceas/metacat/dataone/MNodeService.java | ||
---|---|---|
1006 | 1006 |
|
1007 | 1007 |
// check for authorization to replicate, null session to act as this source MN |
1008 | 1008 |
try { |
1009 |
allowed = D1Client.getCN().isNodeAuthorized(null, targetNodeSubject, pid, null);
|
|
1009 |
allowed = D1Client.getCN().isNodeAuthorized(null, targetNodeSubject, pid); |
|
1010 | 1010 |
} catch (InvalidToken e1) { |
1011 | 1011 |
throw new ServiceFailure("2181", "Could not determine if node is authorized: " |
1012 | 1012 |
+ e1.getMessage()); |
src/edu/ucsb/nceas/metacat/dataone/CNodeService.java | ||
---|---|---|
873 | 873 |
*/ |
874 | 874 |
@Override |
875 | 875 |
public boolean isNodeAuthorized(Session originatingNodeSession, |
876 |
Subject targetNodeSubject, Identifier pid, Permission replicatePermission)
|
|
876 |
Subject targetNodeSubject, Identifier pid) |
|
877 | 877 |
throws NotImplemented, NotAuthorized, InvalidToken, ServiceFailure, |
878 | 878 |
NotFound, InvalidRequest { |
879 | 879 |
|
Also available in: Unified diff
updated D1 API -- removed Permission.REPLICATE and associated parameters