use of com.pspace.ifs.ksan.gw.format.AccessControlPolicy in project ksan by infinistor.
the class S3Request method isGrantBucket.
protected boolean isGrantBucket(String id, String s3grant) throws GWException {
if (getBucketInfo() == null) {
return false;
}
if (accessControlPolicy == null) {
XmlMapper xmlMapper = new XmlMapper();
try {
accessControlPolicy = xmlMapper.readValue(getBucketInfo().getAcl(), AccessControlPolicy.class);
} catch (JsonMappingException e) {
logger.error(e.getMessage());
throw new GWException(GWErrorCode.INTERNAL_SERVER_ERROR, s3Parameter);
} catch (JsonProcessingException e) {
logger.error(e.getMessage());
throw new GWException(GWErrorCode.INTERNAL_SERVER_ERROR, s3Parameter);
}
}
logger.info(GWConstants.LOG_REQUEST_CHECK_ACL_ID_GRANT, id, s3grant);
logger.info(GWConstants.LOG_REQUEST_BUCKET_ACL, getBucketInfo().getAcl());
logger.info(GWConstants.LOG_REQUEST_BUCKET_OWNER_ID, accessControlPolicy.owner.id);
if (accessControlPolicy.aclList.grants == null) {
return false;
}
return checkGrant(id, s3grant, accessControlPolicy);
}
Aggregations