Search in sources :

Example 1 with SetAclEntry

use of alluxio.proto.journal.File.SetAclEntry in project alluxio by Alluxio.

the class InodeTreePersistentState method applySetAcl.

private void applySetAcl(SetAclEntry entry) {
    MutableInode<?> inode = mInodeStore.getMutable(entry.getId()).get();
    List<AclEntry> entries = StreamUtils.map(ProtoUtils::fromProto, entry.getEntriesList());
    switch(entry.getAction()) {
        case REPLACE:
            // fully replace the acl for the path
            inode.replaceAcl(entries);
            break;
        case MODIFY:
            inode.setAcl(entries);
            break;
        case REMOVE:
            inode.removeAcl(entries);
            break;
        case REMOVE_ALL:
            inode.removeExtendedAcl();
            break;
        case REMOVE_DEFAULT:
            inode.setDefaultACL(new DefaultAccessControlList(inode.getACL()));
            break;
        default:
            LOG.warn("Unrecognized acl action: " + entry.getAction());
    }
    mInodeStore.writeInode(inode);
}
Also used : DefaultAccessControlList(alluxio.security.authorization.DefaultAccessControlList) SetAclEntry(alluxio.proto.journal.File.SetAclEntry) AclEntry(alluxio.security.authorization.AclEntry) ProtoUtils(alluxio.util.proto.ProtoUtils)

Aggregations

SetAclEntry (alluxio.proto.journal.File.SetAclEntry)1 AclEntry (alluxio.security.authorization.AclEntry)1 DefaultAccessControlList (alluxio.security.authorization.DefaultAccessControlList)1 ProtoUtils (alluxio.util.proto.ProtoUtils)1