Revision 5298
Added by Matt Jones about 14 years ago
PermissionController.java | ||
---|---|---|
231 | 231 |
*/ |
232 | 232 |
private boolean hasPermissionForInlineData(String user, String[] groups, |
233 | 233 |
String myPermission, String inlineDataId) |
234 |
throws Exception
|
|
234 |
throws McdbException
|
|
235 | 235 |
{ |
236 | 236 |
// this method can call the public method - hasPermission(...) |
237 | 237 |
// the only difference is about the ownership, you couldn't find the owner |
238 | 238 |
// from inlinedataId directly. You should get it from eml document itself |
239 | 239 |
String []userPackage = createUsersPackage(user, groups); |
240 |
if (containDocumentOwner(userPackage, docId)) |
|
241 |
{ |
|
242 |
return true; |
|
243 |
} |
|
244 |
else |
|
245 |
{ |
|
246 |
PermissionController controller = |
|
247 |
new PermissionController(inlineDataId, false); |
|
248 |
return controller.hasPermission(user, groups, myPermission); |
|
249 |
} |
|
240 |
try { |
|
241 |
if (containDocumentOwner(userPackage, docId)) |
|
242 |
{ |
|
243 |
return true; |
|
244 |
} |
|
245 |
else |
|
246 |
{ |
|
247 |
PermissionController controller = |
|
248 |
new PermissionController(inlineDataId, false); |
|
249 |
return controller.hasPermission(user, groups, myPermission); |
|
250 |
} |
|
251 |
} catch (SQLException e) { |
|
252 |
throw new McdbException(e.getMessage()); |
|
253 |
} |
|
250 | 254 |
} |
251 | 255 |
|
252 | 256 |
/** |
... | ... | |
964 | 968 |
public static Hashtable<String, String> getUnReadableInlineDataIdList(String docidWithoutRev, |
965 | 969 |
String user, String[] groups, |
966 | 970 |
boolean withRevision) |
967 |
throws Exception |
|
971 |
throws McdbException
|
|
968 | 972 |
{ |
969 | 973 |
Hashtable<String, String> inlineDataList = getUnAccessableInlineDataIdList(docidWithoutRev, |
970 | 974 |
user, groups, AccessControlInterface.READSTRING, |
... | ... | |
1007 | 1011 |
private static Hashtable<String, String> getUnAccessableInlineDataIdList(String docid, |
1008 | 1012 |
String user, String[] groups, String permission, |
1009 | 1013 |
boolean withRevision) |
1010 |
throws SQLException,McdbException, Exception
|
|
1014 |
throws McdbException
|
|
1011 | 1015 |
{ |
1012 |
Hashtable<String, String> unAccessibleIdList = new Hashtable(); |
|
1013 |
if (user == null) { |
|
1014 |
return unAccessibleIdList; |
|
1015 |
} |
|
1016 |
|
|
1017 |
Hashtable allIdList = getAllInlineDataIdList(docid); |
|
1018 |
Enumeration<String> en = allIdList.keys(); |
|
1016 |
Hashtable<String, String> unAccessibleIdList = new Hashtable(); |
|
1017 |
if (user == null) { |
|
1018 |
return unAccessibleIdList; |
|
1019 |
} |
|
1020 |
|
|
1021 |
Hashtable allIdList; |
|
1022 |
try { |
|
1023 |
allIdList = getAllInlineDataIdList(docid); |
|
1024 |
} catch (SQLException e) { |
|
1025 |
throw new McdbException(e.getMessage()); |
|
1026 |
} |
|
1027 |
Enumeration<String> en = allIdList.keys(); |
|
1019 | 1028 |
while (en.hasMoreElements()) |
1020 | 1029 |
{ |
1021 | 1030 |
String subTreeId = (String) en.nextElement(); |
Also available in: Unified diff
Modified readFromMetacat() to pass most exceptions up the call stack, which
allows creation of new entry points for calling reads. Still need to
continue factoring out the HTTPServletResponse that is passed in in order to
make entrypoints that are not servlet based possible. Problem now is in
setting the content type properly on the servlet response before writing to
the output stream.
Added new dataone interface implementation for the CRUD service, but it is incomplete -- most interfaces thrown NotImplemented for now . The get() method should work but is not tested.