SBucketDao bucketDao = new SBucketDao();
SBucket sbucket = bucketDao.getByName(bucketName);
if (sbucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");
PolicyActions action = (includeVersions ? PolicyActions.ListBucketVersions : PolicyActions.ListBucket);
S3PolicyContext context = new S3PolicyContext( action, bucketName );
context.setEvalParam( ConditionKeys.MaxKeys, new String( "" + maxKeys ));
context.setEvalParam( ConditionKeys.Prefix, prefix );
context.setEvalParam( ConditionKeys.Delimiter, delimiter );
verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_READ );