Bug #2388
isAuthorized() not throwing InvalidRequest when bad permission passed in
100%
Description
mn/isAuthorized/somePID?action=booBoo should throw InvalidRequest, but throws NotAuthorized like the following:
null not allowed on somePID
metacat/restservice/MNResourceHandler.isAuthorized(..) relies on types.v1.Permission.convert(String) to throw exception, but Permission.convert behavior is "garbage in = null out"
public enum Permission ... {
public static Permission convert(String value) {
for (Permission inst : values()) {
if (inst.xmlValue().equals(value)) {
return inst;
}
}
return null;
}
}
Lastly, metacat/dataone/D1NodeService.isAuthorized() does not check for bogus permissions.
History
#1 Updated by Ben Leinfelder over 12 years ago
- Status changed from New to Closed
Updated Metacat trunk to reflect this change. Not sure where/when it will be deployed next