Search in sources :

Example 11 with DefaultAccessControlList

use of alluxio.security.authorization.DefaultAccessControlList 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

DefaultAccessControlList (alluxio.security.authorization.DefaultAccessControlList)11 AccessControlList (alluxio.security.authorization.AccessControlList)10 AlluxioURI (alluxio.AlluxioURI)4 FileAlreadyExistsException (alluxio.exception.FileAlreadyExistsException)3 Mode (alluxio.security.authorization.Mode)3 UnderFileSystem (alluxio.underfs.UnderFileSystem)3 Pair (alluxio.collections.Pair)2 CreateDirectoryContext (alluxio.master.file.contexts.CreateDirectoryContext)2 CreateFileContext (alluxio.master.file.contexts.CreateFileContext)2 LockedInodePath (alluxio.master.file.meta.LockedInodePath)2 MountTable (alluxio.master.file.meta.MountTable)2 AclEntry (alluxio.security.authorization.AclEntry)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 BlockInfoException (alluxio.exception.BlockInfoException)1 DirectoryNotEmptyException (alluxio.exception.DirectoryNotEmptyException)1 FileDoesNotExistException (alluxio.exception.FileDoesNotExistException)1 InvalidPathException (alluxio.exception.InvalidPathException)1 SetAttributePOptions (alluxio.grpc.SetAttributePOptions)1 CompleteFileContext (alluxio.master.file.contexts.CompleteFileContext)1