ivandika3 commented on code in PR #6319:
URL: https://github.com/apache/ozone/pull/6319#discussion_r1510606682
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OzoneAcl.java:
##########
@@ -293,17 +246,46 @@ public String getName() {
return name;
}
- /**
- * Returns Rights.
- *
- * @return - Rights
- */
- public BitSet getAclBitSet() {
- return aclBitSet;
+ @JsonIgnore
+ public boolean isEmpty() {
+ return aclBitSet.isEmpty();
+ }
+
+ public boolean isSet(ACLType acl) {
+ return aclBitSet.get(acl.ordinal());
+ }
+
+ public boolean checkAccess(ACLType acl) {
+ return ((aclBitSet.get(acl.ordinal())
Review Comment:
Nit: let's reuse `isSet` for this
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneAclUtil.java:
##########
@@ -160,18 +162,22 @@ public static boolean
checkIfAclBitIsSet(IAccessAuthorizer.ACLType acl,
* OzoneUtils.addAcl().
* @param acls
* @param parentAcls
+ * @param scope
Review Comment:
Thanks for making this easier. Could you help update the Javadoc for
`inheritDefaultAcls`?
> Helper function to inherit default ACL as access ACL for child object
Is outdated since the inherited ACLs can be of DEFAULT scope (for directory
ACLs)
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OzoneAcl.java:
##########
@@ -43,65 +47,34 @@
* <li>world::rw
* </ul>
*/
-@JsonIgnoreProperties(value = {"aclBitSet"})
public class OzoneAcl {
private static final String ACL_SCOPE_REGEX = ".*\\[(ACCESS|DEFAULT)\\]";
- private ACLIdentityType type;
- private String name;
- private BitSet aclBitSet;
- private AclScope aclScope;
+ private final ACLIdentityType type;
+ private final String name;
+ @JsonIgnore
+ private final BitSet aclBitSet;
+ private final AclScope aclScope;
private static final List<ACLType> EMPTY_LIST = new ArrayList<>(0);
- public static final BitSet ZERO_BITSET = new BitSet(0);
- /**
- * Default constructor.
- */
- public OzoneAcl() {
+ // TODO use varargs constructor
Review Comment:
Can this be done in this patch? Seems the other constructors already using
varargs.
If there are a lot of codes that construct the `OzoneAcl` this way, perhaps
we can defer this to another patch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]