/** * Update the mask to be the union of owning group entry, named user entry and named group entry. * This method must be called when the aforementioned entries are modified. */ public void updateMask() { if (hasExtended()) { AclActions actions = getOwningGroupActions(); mExtendedEntries.updateMask(actions); } }
/** * Returns a list of {@link AclEntry} which represent this ACL instance. The mask will only be * included if extended ACL entries exist. * * @return an immutable list of ACL entries */ public List<AclEntry> getEntries() { ImmutableList.Builder<AclEntry> builder = new ImmutableList.Builder<>(); builder.add(new AclEntry.Builder() .setType(AclEntryType.OWNING_USER) .setSubject(mOwningUser) .setActions(getOwningUserActions()) .build()); builder.add(new AclEntry.Builder() .setType(AclEntryType.OWNING_GROUP) .setSubject(mOwningGroup) .setActions(getOwningGroupActions()) .build()); builder.add(new AclEntry.Builder() .setType(AclEntryType.OTHER) .setActions(getOtherActions()) .build()); if (hasExtended()) { builder.addAll(mExtendedEntries.getEntries()); } return builder.build(); }
if (groups.contains(mOwningGroup)) { isGroupKnown = true; groupActions.merge(getOwningGroupActions());
builder.addGroupActions(Acl.NamedAclActions.newBuilder() .setName(AccessControlList.OWNING_GROUP_KEY) .setActions(toProto(acl.getOwningGroupActions())) .build()); builder.setOtherActions(toProto(acl.getOtherActions()));