Example #1
0
		//-------------------------------------------------------------------------------------
		/// <summary>
		/// Метод инициализации набора доступов из указанного набора.
		/// </summary>
		/// <param name="ia">Набор, из которого проводится инициализация.</param>
		public void InitFrom(SecurityItemAccess ia)
		{
			if(Browse == SecurityAccess.NotSet && (ia.Browse == SecurityAccess.Set || ia.Browse == SecurityAccess.Browse))
				this.Browse = SecurityAccess.Browse;
			if(Level1 == SecurityAccess.NotSet && (ia.Level1 == SecurityAccess.Set || ia.Level1 == SecurityAccess.Browse))
				this.Level1 = SecurityAccess.Browse;
			if(Level2 == SecurityAccess.NotSet && (ia.Level2 == SecurityAccess.Set || ia.Level2 == SecurityAccess.Browse))
				this.Level2 = SecurityAccess.Browse;
			if(Level3 == SecurityAccess.NotSet && (ia.Level3 == SecurityAccess.Set || ia.Level3 == SecurityAccess.Browse))
				this.Level3 = SecurityAccess.Browse;
		}
Example #2
0
		//-------------------------------------------------------------------------------------
		/// <summary>
		/// Метод объединения (сложения) наборов доступов.
		/// </summary>
		/// <param name="ia">Добавляемый набор доступов.</param>
		public void Join(SecurityItemAccess ia)
		{
			if(ia.Browse != SecurityAccess.Browse)
				this.Browse = ia.Browse;
			if(ia.Level1 != SecurityAccess.Browse)
				this.Level1 = ia.Level1;
			if(ia.Level2 != SecurityAccess.Browse)
				this.Level2 = ia.Level2;
			if(ia.Level3 != SecurityAccess.Browse)
				this.Level3 = ia.Level3;
		}