Esempio n. 1
0
		public bool IsUsrAllowedAccess(Usr usr)
		{
			return usr.IsAdmin || ((this.PromoterK > 0 && usr.IsPromoter && usr.IsPromoterK(this.PromoterK)) || (this.PromoterK == 0 && this.UsrK > 0 && usr.K == this.UsrK));
		}
Esempio n. 2
0
		public bool IsPromoter(Usr user)
		{
			foreach (Brand b in this.Brands)
			{
				if (user.IsPromoterK(b.PromoterK))
					return true;
			}
			if (user.IsPromoterK(this.Venue.PromoterK))
				return true;
			return false;
		}
Esempio n. 3
0
		public void SetUsrAndActionUsr(Usr CurrentUsr, bool overrideExisting)
		{
			if (this.PromoterK > 0)
			{
				if (CurrentUsr.IsPromoterK(this.PromoterK))
					this.UsrK = CurrentUsr.K;
				else if (this.Promoter != null && this.Promoter.PrimaryUsrK != 0)
				{
					// For instance when an admin does it on a promoter's behalf
					this.UsrK = this.Promoter.PrimaryUsrK;
				}
				else
					this.UsrK = CurrentUsr.K;
			}
			// If there is no Promoter
			else if(overrideExisting || this.UsrK == 0)
			{
				this.UsrK = CurrentUsr.K;
			}
			if (overrideExisting || this.ActionUsrK == 0)
				this.ActionUsrK = CurrentUsr.K;
		}
Esempio n. 4
0
		public bool IsUsrAllowedAccess(Usr usr)
		{
			return usr.IsAdmin || (this.K > 0 && usr.IsPromoter && usr.IsPromoterK(this.K));
		}