Skip to content

Commit 37d16ba

Browse files
authored
Merge pull request #100217 from normesta/normesta-reg-updates
Normesta reg updates
2 parents f2fe644 + 6ce3fba commit 37d16ba

File tree

2 files changed

+49
-7
lines changed

2 files changed

+49
-7
lines changed

articles/storage/blobs/data-lake-storage-directory-file-acl-powershell.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,19 +337,60 @@ This example gives a user write and execute permission on a directory.
337337
$filesystemName = "my-file-system"
338338
$dirname = "my-directory/"
339339
$Id = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
340+
341+
# Get the directory ACL
340342
$acl = (Get-AzDataLakeGen2Item -Context $ctx -FileSystem $filesystemName -Path $dirname).ACL
341-
$acl = New-AzDataLakeGen2ItemAclObject -AccessControlType user -EntityId $id -Permission "-wx" -InputObject $acl
342-
Update-AzDataLakeGen2Item -Context $ctx -FileSystem $filesystemName -Path $dirname -Acl $acl
343+
344+
# Create the new ACL object.
345+
[Collections.Generic.List[System.Object]]$aclnew =$acl
346+
347+
# To avoid duplicate ACL, remove the ACL entries that will be added later.
348+
foreach ($a in $aclnew)
349+
{
350+
if ($a.AccessControlType -eq "group" -and $a.DefaultScope -eq $true-and $a.EntityId -eq $id)
351+
{
352+
$aclnew.Remove($a);
353+
break;
354+
}
355+
}
356+
357+
# Add ACL Entries
358+
$aclnew = New-AzDataLakeGen2ItemAclObject -AccessControlType group -EntityId $id -Permission "-wx" -DefaultScope -InputObject $aclnew
359+
360+
# Update ACL on server
361+
Update-AzDataLakeGen2Item -Context $ctx -FileSystem $filesystemName -Path $dirname -Acl $aclnew
362+
343363
```
364+
344365
This example gives a user write and execute permission on a file.
345366

346367
```powershell
347368
$filesystemName = "my-file-system"
348369
$fileName = "my-directory/upload.txt"
349370
$Id = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
371+
372+
# Get the file ACL
350373
$acl = (Get-AzDataLakeGen2Item -Context $ctx -FileSystem $filesystemName -Path $fileName).ACL
351-
$acl = New-AzDataLakeGen2ItemAclObject -AccessControlType user -EntityId $id -Permission "-wx" -InputObject $acl
352-
Update-AzDataLakeGen2Item -Context $ctx -FileSystem $filesystemName -Path $fileName -Acl $acl
374+
375+
# Create the new ACL object.
376+
[Collections.Generic.List[System.Object]]$aclnew =$acl
377+
378+
# To avoid duplicate ACL, remove the ACL entries that will be added later.
379+
foreach ($a in $aclnew)
380+
{
381+
if ($a.AccessControlType -eq "group" -and $a.DefaultScope -eq $true-and $a.EntityId -eq $id)
382+
{
383+
$aclnew.Remove($a);
384+
break;
385+
}
386+
}
387+
388+
# Add ACL Entries
389+
$aclnew = New-AzDataLakeGen2ItemAclObject -AccessControlType group -EntityId $id -Permission "-wx" -DefaultScope -InputObject $aclnew
390+
391+
# Update ACL on server
392+
Update-AzDataLakeGen2Item -Context $ctx -FileSystem $filesystemName -Path $fileName -Acl $aclnew
393+
353394
```
354395

355396
### Set permissions on all items in a file system

articles/storage/blobs/data-lake-storage-known-issues.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ Unmanaged VM disks are not supported in accounts that have a hierarchical namesp
4444

4545
## Filesystem Support in SDKs
4646

47-
- .NET, Java and Python are in public preview. Other SDKs are not currently supported.
48-
- Get and Set ACLs operations are not currently recursive.
47+
- [.NET](data-lake-storage-directory-file-acl-dotnet.md), [Java](data-lake-storage-directory-file-acl-java.md) and [Python](data-lake-storage-directory-file-acl-python.md) support are in public preview. Other SDKs are not currently supported.
48+
- Get and set ACL operations are not currently recursive.
4949

5050
## Filesystem Support in PowerShell and Azure CLI
5151

52-
Get and Set ACLs operations are not currently recursive.
52+
- [PowerShell](data-lake-storage-directory-file-acl-powershell.md) and [Azure CLI](data-lake-storage-directory-file-acl-cli.md) support are in public preview.
53+
- Get and set ACL operations are not currently recursive.
5354

5455
## Support for other Blob Storage features
5556

0 commit comments

Comments
 (0)