Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ OzoneVolume getVolumeDetails(String volumeName)
* This is possible for owners of the volume and admin users
* @throws IOException
*/
@Deprecated
boolean checkVolumeAccess(String volumeName, OzoneAcl acl)
throws IOException;

Expand Down Expand Up @@ -228,6 +229,7 @@ void deleteBucket(String volumeName, String bucketName)
* @param bucketName Name of the Bucket
* @throws IOException
*/
@Deprecated
void checkBucketAccess(String volumeName, String bucketName)
throws IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;

import static org.apache.hadoop.ozone.OzoneAcl.AclScope.ACCESS;
import static org.apache.hadoop.ozone.OzoneConsts.OLD_QUOTA_DEFAULT;

Expand Down Expand Up @@ -247,7 +248,7 @@ public void createVolume(String volumeName, VolumeArgs volArgs)
List<OzoneAcl> listOfAcls = new ArrayList<>();
//User ACL
listOfAcls.add(new OzoneAcl(ACLIdentityType.USER,
owner, userRights, ACCESS));
owner, userRights, ACCESS));
//Group ACLs of the User
List<String> userGroups = Arrays.asList(UserGroupInformation
.createRemoteUser(owner).getGroupNames());
Expand All @@ -270,7 +271,7 @@ public void createVolume(String volumeName, VolumeArgs volArgs)
//Remove duplicates and add ACLs
for (OzoneAcl ozoneAcl :
listOfAcls.stream().distinct().collect(Collectors.toList())) {
builder.addOzoneAcls(OzoneAcl.toProtobuf(ozoneAcl));
builder.addOzoneAcls(ozoneAcl);
}

if (volArgs.getQuotaInBytes() == 0) {
Expand Down Expand Up @@ -324,8 +325,7 @@ public OzoneVolume getVolumeDetails(String volumeName)
volume.getUsedNamespace(),
volume.getCreationTime(),
volume.getModificationTime(),
volume.getAclMap().ozoneAclGetProtobuf().stream().
map(OzoneAcl::fromProtobuf).collect(Collectors.toList()),
volume.getAcls(),
volume.getMetadata());
}

Expand Down Expand Up @@ -359,8 +359,7 @@ public List<OzoneVolume> listVolumes(String volumePrefix, String prevVolume,
volume.getUsedNamespace(),
volume.getCreationTime(),
volume.getModificationTime(),
volume.getAclMap().ozoneAclGetProtobuf().stream().
map(OzoneAcl::fromProtobuf).collect(Collectors.toList())))
volume.getAcls()))
.collect(Collectors.toList());
}

Expand All @@ -382,8 +381,7 @@ public List<OzoneVolume> listVolumes(String user, String volumePrefix,
volume.getUsedNamespace(),
volume.getCreationTime(),
volume.getModificationTime(),
volume.getAclMap().ozoneAclGetProtobuf().stream().
map(OzoneAcl::fromProtobuf).collect(Collectors.toList()),
volume.getAcls(),
volume.getMetadata()))
.collect(Collectors.toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,10 @@ public Builder setAcls(List<OzoneAcl> listOfAcls) {
return this;
}

public List<OzoneAcl> getAcls() {
return acls;
}

public Builder addAcl(OzoneAcl ozoneAcl) {
if (ozoneAcl != null) {
this.acls.add(ozoneAcl);
Expand Down
Loading