public Task <AccessControl> GetAccessControlAsync(string fullPath, bool getUpn = false, CancellationToken cancellationToken = default) { return(_storage.GetAccessControlAsync(fullPath, getUpn, cancellationToken)); }
public async Task Acl_assign_permisssions_to_file_for_user() { string path = StoragePath.Combine(Filesystem, Guid.NewGuid().ToString()); string userId = _settings.AzureDataLakeGen2TestObjectId; //write something await _storage.WriteTextAsync(path, "perm?"); //check that user has no permissions AccessControl access = await _storage.GetAccessControlAsync(path); Assert.DoesNotContain(access.Acl, x => x.Identity == userId); //assign user a write permission access.Acl.Add(new AclEntry(ObjectType.User, userId, false, true, false)); await _storage.SetAccessControlAsync(path, access); //check user has permissions now access = await _storage.GetAccessControlAsync(path); AclEntry userAcl = access.Acl.First(e => e.Identity == userId); Assert.False(userAcl.CanRead); Assert.True(userAcl.CanWrite); Assert.False(userAcl.CanExecute); }
private async Task InitialiseAsync() { AccessControl acl = await _azureDataLakeStorage.GetAccessControlAsync(Blob, true); Acl = new EditableAcl(acl); }