Esempio n. 1
0
        public override void GetAccessListInfo(ObjInfoFlags flags, out AccessRightInfo[] rights, out uint defaultIndex)
        {
            rights = new AccessRightInfo[] {
                new AccessRightInfo(0x1F01FF, ResStr("FileRightFullControl"), AccessFlags.General | AccessFlags.Specific | AccessFlags.ContainerInheritAce | AccessFlags.ObjectInheritAce),
                new AccessRightInfo(0x1200A9, ResStr("FileRightListFolderContents"), AccessFlags.Container | AccessFlags.ContainerInheritAce),
                new AccessRightInfo(0x120089, ResStr("FileRightRead"), AccessFlags.General | AccessFlags.ContainerInheritAce | AccessFlags.ObjectInheritAce),
                new AccessRightInfo(0x120116, ResStr("FileRightWrite"), AccessFlags.General | AccessFlags.ContainerInheritAce | AccessFlags.ObjectInheritAce),
                new AccessRightInfo(0x1200A0, ResStr("TaskRightExecute"), AccessFlags.General | AccessFlags.ContainerInheritAce | AccessFlags.ObjectInheritAce),

                new AccessRightInfo(0x000001, ResStr("FileRightReadData"), AccessFlags.Specific),
                new AccessRightInfo(0x000002, ResStr("FileRightWriteData"), AccessFlags.Specific),
                new AccessRightInfo(0x000004, ResStr("FileRightAppendData"), AccessFlags.Specific),
                new AccessRightInfo(0x000008, ResStr("FileRightReadExtendedAttributes"), AccessFlags.Specific),
                new AccessRightInfo(0x000010, ResStr("FileRightWriteExtendedAttributes"), AccessFlags.Specific),
                new AccessRightInfo(0x000020, ResStr("FileRightExecuteFile"), AccessFlags.Specific),
                new AccessRightInfo(0x000040, ResStr("FileRightDeleteSubdirectoriesAndFiles"), AccessFlags.Specific),
                new AccessRightInfo(0x000080, ResStr("FileRightReadAttributes"), AccessFlags.Specific),
                new AccessRightInfo(0x000100, ResStr("FileRightWriteAttributes"), AccessFlags.Specific),
                new AccessRightInfo(0x010000, ResStr("StdRightDelete"), AccessFlags.Specific),
                new AccessRightInfo((uint)FileSystemRights.ReadPermissions, ResStr("FileRightReadPermissions"), AccessFlags.Specific),
                new AccessRightInfo((uint)FileSystemRights.ChangePermissions, ResStr("FileRightChangePermissions"), AccessFlags.Specific),
                new AccessRightInfo((uint)FileSystemRights.TakeOwnership, ResStr("StdRightTakeOwnership"), AccessFlags.Specific),
                new AccessRightInfo(0x100000, ResStr("Synchronize"), AccessFlags.Specific),

                new AccessRightInfo(0x1F019F, ResStr("FileRightReadWriteAndExecute"), AccessFlags.Ignore),
                new AccessRightInfo(0, ResStr("File"), AccessFlags.Ignore)
            };
            defaultIndex = 3;
        }
Esempio n. 2
0
 public override void GetAccessListInfo(ObjInfoFlags flags, out AccessRightInfo[] rights, out uint defaultIndex)
 {
     rights = new AccessRightInfo[] {
         new AccessRightInfo((uint)FileSystemRights.FullControl, ResStr("FileRightFullControl"), AccessFlags.General | AccessFlags.Specific | AccessFlags.ContainerInheritAce | AccessFlags.ObjectInheritAce),
         new AccessRightInfo((uint)FileSystemRights.Modify, ResStr("FileRightModify"), AccessFlags.General | AccessFlags.ContainerInheritAce | AccessFlags.ObjectInheritAce),
         new AccessRightInfo((uint)FileSystemRights.ReadAndExecute, ResStr("FileRightReadAndExecute"), AccessFlags.General | AccessFlags.ContainerInheritAce | AccessFlags.ObjectInheritAce),
         new AccessRightInfo((uint)FileSystemRights.ReadAndExecute, ResStr("FileRightListFolderContents"), AccessFlags.Container | AccessFlags.ContainerInheritAce),
         new AccessRightInfo((uint)FileSystemRights.Read, ResStr("FileRightRead"), AccessFlags.General | AccessFlags.ContainerInheritAce | AccessFlags.ObjectInheritAce),
         new AccessRightInfo((uint)FileSystemRights.Write, ResStr("FileRightWrite"), AccessFlags.General | AccessFlags.ContainerInheritAce | AccessFlags.ObjectInheritAce),
         new AccessRightInfo((uint)FileSystemRights.ExecuteFile, ResStr("FileRightExecuteFile"), AccessFlags.Specific),
         new AccessRightInfo((uint)FileSystemRights.ReadData, ResStr("FileRightReadData"), AccessFlags.Specific),
         new AccessRightInfo((uint)FileSystemRights.ReadAttributes, ResStr("FileRightReadAttributes"), AccessFlags.Specific),
         new AccessRightInfo((uint)FileSystemRights.ReadExtendedAttributes, ResStr("FileRightReadExtendedAttributes"), AccessFlags.Specific),
         new AccessRightInfo((uint)FileSystemRights.WriteData, ResStr("FileRightWriteData"), AccessFlags.Specific),
         new AccessRightInfo((uint)FileSystemRights.AppendData, ResStr("FileRightAppendData"), AccessFlags.Specific),
         new AccessRightInfo((uint)FileSystemRights.WriteAttributes, ResStr("FileRightWriteAttributes"), AccessFlags.Specific),
         new AccessRightInfo((uint)FileSystemRights.WriteExtendedAttributes, ResStr("FileRightWriteExtendedAttributes"), AccessFlags.Specific),
         new AccessRightInfo((uint)FileSystemRights.DeleteSubdirectoriesAndFiles, ResStr("FileRightDeleteSubdirectoriesAndFiles"), AccessFlags.Specific),
         new AccessRightInfo((uint)FileSystemRights.Delete, ResStr("StdRightDelete"), AccessFlags.Specific),
         new AccessRightInfo((uint)FileSystemRights.ReadPermissions, ResStr("FileRightReadPermissions"), AccessFlags.Specific),
         new AccessRightInfo((uint)FileSystemRights.ChangePermissions, ResStr("FileRightChangePermissions"), AccessFlags.Specific),
         new AccessRightInfo((uint)FileSystemRights.TakeOwnership, ResStr("StdRightTakeOwnership"), AccessFlags.Specific),
         new AccessRightInfo((uint)FileSystemRights.Modify, ResStr("FileRightModify"), AccessFlags.Ignore),
         new AccessRightInfo((uint)FileSystemRights.ReadAndExecute, ResStr("FileRightReadAndExecute"), AccessFlags.Ignore),
         new AccessRightInfo((uint)(FileSystemRights.Write | FileSystemRights.ExecuteFile), ResStr("FileRightWriteAndExecute"), AccessFlags.Ignore),
         new AccessRightInfo((uint)(FileSystemRights.ReadAndExecute | FileSystemRights.Write), ResStr("FileRightReadWriteAndExecute"), AccessFlags.Ignore),
         new AccessRightInfo(0, ResStr("File"), AccessFlags.Ignore)
     };
     defaultIndex = 3;
 }
Esempio n. 3
0
 /// <summary>
 /// Gets an array of <see cref="AccessRightInfo"/> structures which define how to display
 /// different access rights supplied to the editor along with the index of the access right
 /// that should be applied to new ACEs.
 /// </summary>
 /// <param name="flags">
 /// A set of bit flags that indicate the property page being initialized. This value is zero
 /// if the basic security page is being initialized.
 /// </param>
 /// <param name="rights">The access right information for each right.</param>
 /// <param name="defaultIndex">
 /// The default index in the <paramref name="rights"/> array for new ACEs.
 /// </param>
 virtual public void GetAccessListInfo(ObjInfoFlags flags, out AccessRightInfo[] rights, out uint defaultIndex)
 {
     rights = new AccessRightInfo[] {
         new AccessRightInfo(0, ResStr("Object"), (AccessFlags)0)
     };
     defaultIndex = 0;
 }
Esempio n. 4
0
        private void SetChecks(ObjInfoFlags flags, bool check)
        {
            var i = checkBoxList.Items.Find(delegate(GroupControls.CheckBoxListItem item) { return(flags == (ObjInfoFlags)item.Tag); });

            if (i != null)
            {
                i.Checked = check;
            }
        }
Esempio n. 5
0
 private void SetFlag(ObjInfoFlags flag, bool set, bool reqAdvanced = false)
 {
     if (set)
     {
         if (reqAdvanced)
         {
             flag |= ObjInfoFlags.Advanced;
         }
         Flags |= flag;
     }
     else
     {
         Flags &= ~flag;
     }
 }
Esempio n. 6
0
 public SI_OBJECT_INFO(ObjInfoFlags flags, string objectName, string serverName, string pageTitle, Guid objectGuid)
 {
     Flags          = flags;
     hInstance      = IntPtr.Zero;
     ObjectName     = objectName;
     ServerName     = serverName;
     PageTitle      = pageTitle;
     ObjectTypeGuid = objectGuid;
     if (PageTitle != null)
     {
         Flags |= ObjInfoFlags.PageTitle;
     }
     if (ObjectTypeGuid != Guid.Empty)
     {
         Flags |= ObjInfoFlags.ObjectGuid;
     }
 }
        void NativeMethods.ISecurityInformation3.OpenElevatedEditor(IntPtr hWnd, uint uPage)
        {
            SecurityPageType       pgType = (SecurityPageType)(uPage & 0x0000FFFF);
            SecurityPageActivation pgActv = (SecurityPageActivation)((uPage >> 16) & 0x0000FFFF);

            System.Diagnostics.Debug.WriteLine(string.Format("OpenElevatedEditor: {0} - {1}", pgType, pgActv));
            ObjInfoFlags lastElev = currentElevation;

            switch (pgActv)
            {
            case SecurityPageActivation.ShowDefault:
                currentElevation |= (ObjInfoFlags.PermsElevationRequired | ObjInfoFlags.ViewOnly);
                break;

            case SecurityPageActivation.ShowPermActivated:
                currentElevation |= (ObjInfoFlags.PermsElevationRequired | ObjInfoFlags.ViewOnly);
                pgType            = SecurityPageType.AdvancedPermissions;
                break;

            case SecurityPageActivation.ShowAuditActivated:
                currentElevation |= ObjInfoFlags.AuditElevationRequired;
                pgType            = SecurityPageType.Audit;
                break;

            case SecurityPageActivation.ShowOwnerActivated:
                currentElevation |= ObjInfoFlags.OwnerElevationRequired;
                pgType            = SecurityPageType.Owner;
                break;

            case SecurityPageActivation.ShowEffectiveActivated:
                break;

            case SecurityPageActivation.ShowShareActivated:
                break;

            case SecurityPageActivation.ShowCentralPolicyActivated:
                break;

            default:
                break;
            }
            ShowDialog(hWnd, pgType, pgActv);
            currentElevation = lastElev;
        }
Esempio n. 8
0
 public override void GetAccessListInfo(ObjInfoFlags flags, out AccessRightInfo[] rights, out uint defaultIndex)
 {
     rights = new AccessRightInfo[] {
         new AccessRightInfo((uint)RegistryRights.FullControl, ResStr("FileRightFullControl"), AccessFlags.General | AccessFlags.Specific | AccessFlags.ContainerInheritAce | AccessFlags.ObjectInheritAce),
         new AccessRightInfo((uint)RegistryRights.ReadKey, ResStr("FileRightRead"), AccessFlags.General | AccessFlags.ContainerInheritAce | AccessFlags.ObjectInheritAce),
         new AccessRightInfo((uint)RegistryRights.QueryValues, ResStr("RegistryRightQueryValues"), AccessFlags.Specific),
         new AccessRightInfo((uint)RegistryRights.SetValue, ResStr("RegistryRightSetValue"), AccessFlags.Specific),
         new AccessRightInfo((uint)RegistryRights.CreateSubKey, ResStr("RegistryRightCreateSubKey"), AccessFlags.Specific),
         new AccessRightInfo((uint)RegistryRights.EnumerateSubKeys, ResStr("RegistryRightEnumerateSubKeys"), AccessFlags.Specific),
         new AccessRightInfo((uint)RegistryRights.Notify, ResStr("RegistryRightNotify"), AccessFlags.Specific),
         new AccessRightInfo((uint)RegistryRights.CreateLink, ResStr("RegistryRightCreateLink"), AccessFlags.Specific),
         new AccessRightInfo((uint)RegistryRights.Delete, ResStr("StdRightDelete"), AccessFlags.Specific),
         new AccessRightInfo((uint)RegistryRights.ChangePermissions, ResStr("RegistryRightChangePermissions"), AccessFlags.Specific),
         new AccessRightInfo((uint)RegistryRights.TakeOwnership, ResStr("RegistryRightTakeOwnership"), AccessFlags.Specific),
         new AccessRightInfo((uint)RegistryRights.ReadPermissions, ResStr("RegistryRightReadControl"), AccessFlags.Specific),
         new AccessRightInfo(0, ResStr("File"), (AccessFlags)0)
     };
     defaultIndex = 11;
 }
 public SecurityInfoImpl(ObjInfoFlags flags, string objectName, string fullName, string serverName = null, string pageTitle = null)
 {
     ObjectInfo       = new NativeMethods.SI_OBJECT_INFO(flags, objectName, serverName, pageTitle);
     currentElevation = 0;             // flags & (ObjInfoFlags.OwnerElevationRequired | ObjInfoFlags.AuditElevationRequired | ObjInfoFlags.PermsElevationRequired);
     fullObjectName   = fullName;
 }
Esempio n. 10
0
 private bool HasFlag(ObjInfoFlags flag) => ((Flags & flag) == flag);
Esempio n. 11
0
 internal void ResetFlags()
 {
     flags = defaultFlags;
 }
Esempio n. 12
0
 public SI_OBJECT_INFO(ObjInfoFlags flags, string objectName, string serverName, string pageTitle)
     : this(flags, objectName, serverName, pageTitle, Guid.Empty)
 {
 }
Esempio n. 13
0
 public SI_OBJECT_INFO(ObjInfoFlags flags, string objectName)
     : this(flags, objectName, null, null, Guid.Empty)
 {
 }