Skip to content

[Storage] support set/update/remove acl recursive on DatalakeGen2 item #13188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,24 @@ function Test-DatalakeGen2
$dir1 = Get-AzDataLakeGen2Item -Context $storageContext -FileSystem $filesystemName -Path $directoryPath1
Assert-AreEqual $dir1.Path $directoryPath1

# Set ACL recusive
$result = Set-AzDataLakeGen2AclRecursive -Context $storageContext -FileSystem $filesystemName -Acl $acl
Assert-Null $result.FailedEntries
Assert-AreEqual 0 $result.TotalFailureCount
Assert-AreEqual 2 $result.TotalFilesSuccessfulCount
Assert-AreEqual 3 $result.TotalDirectoriesSuccessfulCount
$result = Update-AzDataLakeGen2AclRecursive -Context $storageContext -FileSystem $filesystemName -Path $directoryPath1 -Acl $acl -BatchSize 2 -MaxBatchCount 2
Assert-Null $result.FailedEntries
Assert-AreEqual 0 $result.TotalFailureCount
Assert-AreEqual 1 $result.TotalFilesSuccessfulCount
Assert-AreEqual 1 $result.TotalDirectoriesSuccessfulCount
$acl2 = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx -DefaultScope
$result = Remove-AzDataLakeGen2AclRecursive -Context $storageContext -FileSystem $filesystemName -Acl $acl2
Assert-Null $result.FailedEntries
Assert-AreEqual 0 $result.TotalFailureCount
Assert-AreEqual 2 $result.TotalFilesSuccessfulCount
Assert-AreEqual 3 $result.TotalDirectoriesSuccessfulCount

# Remove Items
Remove-AzDataLakeGen2Item -Context $storageContext -FileSystem $filesystemName -Path $filePath1 -Force
Remove-AzDataLakeGen2Item -Context $storageContext -FileSystem $filesystemName -Path $directoryPath1 -Force
Expand Down
4 changes: 3 additions & 1 deletion src/Storage/Storage.Management/Az.Storage.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ CmdletsToExport = 'Get-AzStorageAccount', 'Get-AzStorageAccountKey',
'Remove-AzStorageObjectReplicationPolicy',
'Enable-AzStorageBlobRestorePolicy',
'Disable-AzStorageBlobRestorePolicy',
'New-AzStorageBlobRangeToRestore', 'Restore-AzStorageBlobRange'
'New-AzStorageBlobRangeToRestore', 'Restore-AzStorageBlobRange',
'Set-AzDataLakeGen2AclRecursive','Update-AzDataLakeGen2AclRecursive',
'Remove-AzDataLakeGen2AclRecursive'

# Variables to export from this module
# VariablesToExport = @()
Expand Down
4 changes: 4 additions & 0 deletions src/Storage/Storage.Management/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
* Supported create/update file share with access tier
- `New-AzRmStorageShare`
- `Update-AzRmStorageShare`
* Supported set/update/remove Acl recursively on Datalake Gen2 item
- `Set-AzDataLakeGen2AclRecursive`
- `Update-AzDataLakeGen2AclRecursive`
- `Remove-AzDataLakeGen2AclRecursive`
* Supported Container access policy with new permission x,t
- `New-AzStorageContainerStoredAccessPolicy`
- `Set-AzStorageContainerStoredAccessPolicy`
Expand Down
9 changes: 9 additions & 0 deletions src/Storage/Storage.Management/help/Az.Storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ Generates an SAS token for an Azure Storage table.
### [New-AzStorageTableStoredAccessPolicy](New-AzStorageTableStoredAccessPolicy.md)
Creates a stored access policy for an Azure storage table.

### [Remove-AzDataLakeGen2AclRecursive](Remove-AzDataLakeGen2AclRecursive.md)
Remove ACL recursively on the specified path.

### [Remove-AzDataLakeGen2Item](Remove-AzDataLakeGen2Item.md)
Remove a file or directory.

Expand Down Expand Up @@ -317,6 +320,9 @@ Revoke all User Delegation keys of a Storage account.
### [Set-AzCurrentStorageAccount](Set-AzCurrentStorageAccount.md)
Modifies the current Storage account of the specified subscription.

### [Set-AzDataLakeGen2AclRecursive](Set-AzDataLakeGen2AclRecursive.md)
Set ACL recursively on the specified path.

### [Set-AzDataLakeGen2ItemAclObject](Set-AzDataLakeGen2ItemAclObject.md)
Creates/Updates a DataLake gen2 item ACL object, which can be used in Update-AzDataLakeGen2Item cmdlet.

Expand Down Expand Up @@ -380,6 +386,9 @@ Stops a copy operation.
### [Stop-AzStorageFileCopy](Stop-AzStorageFileCopy.md)
Stops a copy operation to the specified destination file.

### [Update-AzDataLakeGen2AclRecursive](Update-AzDataLakeGen2AclRecursive.md)
Update ACL recursively on the specified path.

### [Update-AzDataLakeGen2Item](Update-AzDataLakeGen2Item.md)
Update a file or directory on properties, metadata, permission, ACL, and owner.

Expand Down
Loading