Click here to Skip to main content
15,885,278 members
Articles / Programming Languages / Visual Basic

The Windows Access Control Model Part 3

Rate me:
Please Sign up or sign in to vote.
4.80/5 (28 votes)
1 Jul 200525 min read 232.5K   5.2K   126  
In the third part of this series, we will take a tour of the new access control classes coming in .NET v2.0.
namespace NetAccessControl
{
	partial class DACLForm
	{
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		#region Windows Form Designer generated code

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
			this.autoinheritBox = new System.Windows.Forms.CheckBox();
			this.PermsLbl = new System.Windows.Forms.Label();
			this.descriptiveLbl = new System.Windows.Forms.Label();
			this.applyButton = new System.Windows.Forms.Button();
			this.cancelButton = new System.Windows.Forms.Button();
			this.errorLbl = new System.Windows.Forms.Label();
			this.regKeyLbl = new System.Windows.Forms.Label();
			this.daclLView = new System.Windows.Forms.DataGridView();
			this.remapGenericSelect = new System.Windows.Forms.CheckBox();
			this.viewInheritButton = new System.Windows.Forms.Button();
			this.dataGridViewComboBoxColumn1 = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.dataGridViewButtonColumn1 = new System.Windows.Forms.DataGridViewButtonColumn();
			((System.ComponentModel.ISupportInitialize)(this.daclLView)).BeginInit();
			this.SuspendLayout();
			// 
			// autoinheritBox
			// 
			this.autoinheritBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
			this.autoinheritBox.AutoSize = true;
			this.autoinheritBox.Location = new System.Drawing.Point(15, 263);
			this.autoinheritBox.Name = "autoinheritBox";
			this.autoinheritBox.Size = new System.Drawing.Size(179, 17);
			this.autoinheritBox.TabIndex = 4;
			this.autoinheritBox.Tag = "false";
			this.autoinheritBox.Text = "DACL auto-&inherits from its parent";
			this.autoinheritBox.CheckedChanged += new System.EventHandler(this.autoinheritBox_CheckedChanged);
			// 
			// PermsLbl
			// 
			this.PermsLbl.AutoSize = true;
			this.PermsLbl.Location = new System.Drawing.Point(11, 66);
			this.PermsLbl.Name = "PermsLbl";
			this.PermsLbl.Size = new System.Drawing.Size(58, 13);
			this.PermsLbl.TabIndex = 2;
			this.PermsLbl.Text = "&Permissions";
			// 
			// descriptiveLbl
			// 
			this.descriptiveLbl.AutoSize = true;
			this.descriptiveLbl.Location = new System.Drawing.Point(13, 13);
			this.descriptiveLbl.Name = "descriptiveLbl";
			this.descriptiveLbl.Size = new System.Drawing.Size(247, 13);
			this.descriptiveLbl.TabIndex = 0;
			this.descriptiveLbl.Text = "These are the permission entries for the registry key:";
			// 
			// applyButton
			// 
			this.applyButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.applyButton.Enabled = false;
			this.applyButton.Location = new System.Drawing.Point(462, 323);
			this.applyButton.Name = "applyButton";
			this.applyButton.Size = new System.Drawing.Size(75, 23);
			this.applyButton.TabIndex = 8;
			this.applyButton.Text = "&Apply...";
			this.applyButton.Click += new System.EventHandler(this.applyButton_Click);
			// 
			// cancelButton
			// 
			this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.cancelButton.Location = new System.Drawing.Point(543, 323);
			this.cancelButton.Name = "cancelButton";
			this.cancelButton.Size = new System.Drawing.Size(75, 23);
			this.cancelButton.TabIndex = 9;
			this.cancelButton.Text = "&Cancel";
			this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
			// 
			// errorLbl
			// 
			this.errorLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
			this.errorLbl.AutoSize = true;
			this.errorLbl.Enabled = false;
			this.errorLbl.Location = new System.Drawing.Point(14, 323);
			this.errorLbl.Name = "errorLbl";
			this.errorLbl.Size = new System.Drawing.Size(30, 13);
			this.errorLbl.TabIndex = 7;
			this.errorLbl.Text = "Errors";
			this.errorLbl.Visible = false;
			// 
			// regKeyLbl
			// 
			this.regKeyLbl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.regKeyLbl.AutoEllipsis = true;
			this.regKeyLbl.Location = new System.Drawing.Point(14, 30);
			this.regKeyLbl.Name = "regKeyLbl";
			this.regKeyLbl.Size = new System.Drawing.Size(603, 23);
			this.regKeyLbl.TabIndex = 1;
			this.regKeyLbl.Text = "RegKey";
			// 
			// daclLView
			// 
			this.daclLView.AllowUserToDeleteRows = false;
			this.daclLView.AllowUserToOrderColumns = true;
			this.daclLView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
						| System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.daclLView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
			this.daclLView.BackgroundColor = System.Drawing.SystemColors.Info;
			this.daclLView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.SingleVertical;
			this.daclLView.Columns.Add(this.dataGridViewComboBoxColumn1);
			this.daclLView.Columns.Add(this.dataGridViewTextBoxColumn1);
			this.daclLView.Columns.Add(this.dataGridViewTextBoxColumn2);
			this.daclLView.Columns.Add(this.dataGridViewButtonColumn1);
			this.daclLView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
			this.daclLView.Location = new System.Drawing.Point(12, 82);
			this.daclLView.MultiSelect = false;
			this.daclLView.Name = "daclLView";
			this.daclLView.ShowEditingIcon = false;
			this.daclLView.Size = new System.Drawing.Size(605, 173);
			this.daclLView.TabIndex = 3;
			this.daclLView.Text = "dataGridView1";
			this.daclLView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.daclLView_CellClick);
			// 
			// remapGenericSelect
			// 
			this.remapGenericSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
			this.remapGenericSelect.AutoSize = true;
			this.remapGenericSelect.Location = new System.Drawing.Point(14, 286);
			this.remapGenericSelect.Name = "remapGenericSelect";
			this.remapGenericSelect.Size = new System.Drawing.Size(129, 17);
			this.remapGenericSelect.TabIndex = 6;
			this.remapGenericSelect.Text = "Remap &Generic Rights";
			this.remapGenericSelect.CheckedChanged += new System.EventHandler(this.remapGenericSelect_CheckedChanged);
			// 
			// viewInheritButton
			// 
			this.viewInheritButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
			this.viewInheritButton.Enabled = false;
			this.viewInheritButton.Location = new System.Drawing.Point(201, 259);
			this.viewInheritButton.Name = "viewInheritButton";
			this.viewInheritButton.Size = new System.Drawing.Size(146, 23);
			this.viewInheritButton.TabIndex = 5;
			this.viewInheritButton.Text = "Rea&d Inherited ACEs...";
			this.viewInheritButton.Click += new System.EventHandler(this.viewInheritButton_Click);
			// 
			// dataGridViewComboBoxColumn1
			// 
			this.dataGridViewComboBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
			this.dataGridViewComboBoxColumn1.HeaderText = "Type";
			this.dataGridViewComboBoxColumn1.Items.AddRange(new object[] {
            "Allow",
            "Deny"});
			this.dataGridViewComboBoxColumn1.MaxDropDownItems = 2;
			this.dataGridViewComboBoxColumn1.Name = "typeLViewCol";
			this.dataGridViewComboBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.dataGridViewComboBoxColumn1.Width = 141;
			// 
			// dataGridViewTextBoxColumn1
			// 
			this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
			this.dataGridViewTextBoxColumn1.HeaderText = "User Name";
			this.dataGridViewTextBoxColumn1.Name = "userLViewCol";
			// 
			// dataGridViewTextBoxColumn2
			// 
			this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
			this.dataGridViewTextBoxColumn2.HeaderText = "Access Mask";
			this.dataGridViewTextBoxColumn2.MaxInputLength = 8;
			this.dataGridViewTextBoxColumn2.Name = "permsLViewCol";
			// 
			// dataGridViewButtonColumn1
			// 
			this.dataGridViewButtonColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
			dataGridViewCellStyle2.FormatProvider = new System.Globalization.CultureInfo("en-GB");
			this.dataGridViewButtonColumn1.DefaultCellStyle = dataGridViewCellStyle2;
			this.dataGridViewButtonColumn1.HeaderText = "Inheritance";
			this.dataGridViewButtonColumn1.Name = "inheritLViewCol";
			this.dataGridViewButtonColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.dataGridViewButtonColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.dataGridViewButtonColumn1.Text = "View...";
			this.dataGridViewButtonColumn1.ToolTipText = "Views the exact inheritance type";
			this.dataGridViewButtonColumn1.UseColumnTextForButtonValue = true;
			// 
			// DACLForm
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.CancelButton = this.cancelButton;
			this.ClientSize = new System.Drawing.Size(630, 358);
			this.Controls.Add(this.viewInheritButton);
			this.Controls.Add(this.remapGenericSelect);
			this.Controls.Add(this.daclLView);
			this.Controls.Add(this.regKeyLbl);
			this.Controls.Add(this.errorLbl);
			this.Controls.Add(this.cancelButton);
			this.Controls.Add(this.applyButton);
			this.Controls.Add(this.descriptiveLbl);
			this.Controls.Add(this.PermsLbl);
			this.Controls.Add(this.autoinheritBox);
			this.MinimumSize = new System.Drawing.Size(300, 200);
			this.Name = "DACLForm";
			this.Text = "Permissions for registry key";
			this.Load += new System.EventHandler(this.DACLForm_Load);
			((System.ComponentModel.ISupportInitialize)(this.daclLView)).EndInit();
			this.ResumeLayout(false);
			this.PerformLayout();

		}

		#endregion

		private System.Windows.Forms.Label PermsLbl;
		private System.Windows.Forms.Label descriptiveLbl;
		private System.Windows.Forms.Button cancelButton;
		private System.Windows.Forms.Label regKeyLbl;
		private System.Windows.Forms.CheckBox remapGenericSelect;
		protected System.Windows.Forms.CheckBox autoinheritBox;
		protected System.Windows.Forms.Button applyButton;
		protected System.Windows.Forms.Label errorLbl;
		protected System.Windows.Forms.DataGridView daclLView;
		protected System.Windows.Forms.Button viewInheritButton;
		protected System.Windows.Forms.DataGridViewComboBoxColumn dataGridViewComboBoxColumn1;
		private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
		private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
		private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn1;
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
Mr. Shah is a reclusive C++/C# developer lurking somewhere in the depths of the city of London. He learnt physics at Kings' College London and obtained a Master in Science there. Having earned an MCAD, he teeters on the brink of transitioning from C++ to C#, unsure of which language to jump to. Fortunately, he also knows how to use .NET interop to merge code between the two languages (which means he won't have to make the choice anytime soon).

His interests (apart from programming) are walking, football (the real one!), philosophy, history, retro-gaming, strategy gaming, and any good game in general.

He maintains a website / blog / FAQ / junk at shexec32.serveftp.net, where he places the best answers he's written to the questions you've asked. If you can find him, maybe you can hire Mr. Shah to help you with anything C++[/CLI]/C#/.NET related Smile | :) .

Comments and Discussions