use of com.obs.services.model.GrantAndPermission in project jeesuite-libs by vakinge.
the class HuaweicloudProvider method isBucketPrivate.
public boolean isBucketPrivate(String bucketName) {
if (!existsBucket(bucketName)) {
throw new RuntimeException("bucket[" + bucketName + "]不存在");
}
AccessControlList acl = obsClient.getBucketAcl(bucketName);
Set<GrantAndPermission> grants = acl.getGrants();
if (grants != null) {
for (GrantAndPermission grant : grants) {
if (grant.getGrantee().equals(GroupGrantee.ALL_USERS) && grant.getPermission().equals(Permission.PERMISSION_READ)) {
return false;
}
}
}
return true;
}
Aggregations