FileSystemAclExtensions Missing forced SetAccessControl methods #114955
Unanswered
AliveDevil
asked this question in
Q&A
Replies: 1 comment
-
For feature request of new API, you can file an issue of API Proposal. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Current implementation of
FileSystemAclExtensions.SetAccessControl
only works one time - the first time after it has been edited, and then applied to one file or directory.runtime/src/libraries/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/FileSystemSecurity.cs
Lines 117 to 131 in 50c4cb9
The first call to
Persist
throughSetAccessControl
successfully applied all modified sections, but reusing the same FileSystemSecurity object on another FileSystemItem doesn't apply anything, becauseGetAccessControlSectionsFromChanges
returns "None" - thus subsequent calls to Persist are unusable.Please provide an overload
SetAccessControl(string path, AccessControlSections sections)
to apply the same FileSystemSecurity object to multiple FileSystemItems, without having to recreate or modify the FileSystemSecurity object just for the "Changed"-flag.Beta Was this translation helpful? Give feedback.
All reactions