This repository was archived by the owner on Jan 23, 2023. It is now read-only.
[release/3.1] Add file creation method that takes an ACL #42228
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Approved API Proposal: #41614
Original PR merged in 5.0: #42099
Related change for directory creation method that takes an ACL: #41834 [merged and ported to 3.1 Prev2]
Description
We have extension methods in
System.IO.FileSystem.AclExtensionsthat let the user get and set ACLs for existing files, but we do not have methods that create files with predefined ACLs..NET ACL (Access Control List) support is Windows specific. This change will reside inside the
System.IO.FileSystem.AccessControlassembly.Customer impact
Before this change, customers had to create a file or filestream, then set its ACLs. This presents a few problems:
This change addresses those problems by adding a new extension method that allows creating a file and ensuring the provided ACLs are set during creation.
Regression
This change will not cause a regression.
Risk
Medium-Low:
Testing
Added unit tests that verify the ACLs were correctly set and the expected exceptions are thrown.