Beispiel #1
0
        private static SecurityDescriptor CreateSecurityDescriptor()
        {
            SecurityDescriptor ret = new SecurityDescriptor();

            ret.AddAccessAllowedAce(GenericAccessRights.GenericAll, KnownSids.BuiltinAdministrators);
            ret.AddAccessAllowedAce(GenericAccessRights.GenericRead | GenericAccessRights.GenericWrite | GenericAccessRights.GenericExecute, KnownSids.World);
            ret.AddAccessAllowedAce(GenericAccessRights.GenericRead | GenericAccessRights.GenericWrite | GenericAccessRights.GenericExecute, KnownSids.Restricted);
            ret.AddAccessAllowedAce(GenericAccessRights.GenericRead | GenericAccessRights.GenericWrite | GenericAccessRights.GenericExecute, KnownSids.Null);
            ret.AddAccessAllowedAce(GenericAccessRights.GenericRead | GenericAccessRights.GenericWrite | GenericAccessRights.GenericExecute, KnownSids.AllApplicationPackages);
            ret.AddAccessAllowedAce(GenericAccessRights.GenericRead | GenericAccessRights.GenericWrite | GenericAccessRights.GenericExecute, KnownSids.AllRestrictedApplicationPackages);
            ret.AddAccessAllowedAce(GenericAccessRights.GenericRead | GenericAccessRights.GenericWrite | GenericAccessRights.GenericExecute, KnownSids.WriteRestricted);
            ret.AddAccessAllowedAce(GenericAccessRights.GenericRead | GenericAccessRights.GenericWrite | GenericAccessRights.GenericExecute, KnownSids.Anonymous);
            ret.IntegrityLevel = TokenIntegrityLevel.Untrusted;
            return(ret);
        }