Skip to main content

Posts

Showing posts with the label Access Control Lists (ACL)

Using Access Control Lists in .Net

Namespace: System.Security.AccessControl Discretionary Access Control List (DACL) is meant for restricting/granting access to different resources at OS Level to a particular user/group. And Security Access Control Lists (SACL) allows you to audit different resource access permissions. DACL is collection of Access Control Entries (ACE). RegistryRights, FileSystemRights etc. are the ACE enumerations for their respective resources. <Type>Security provides the following Method: (DACL) GetAccessRules , (SACL) GetAuditRules , [ Add | Remove ] AccessRule , [ Add | Remove ] AuditRule . Example: public static void AddFileSecurity(string fileName, string account,             FileSystemRights rights, AccessControlType controlType) {    // Get a FileSecurity object that represents the    // current security settings.    FileSecurity fSecurity = Fil...