예제 #1
0
		public VocaDbPrincipal(IIdentity identity, UserWithPermissionsContract user)
			: base(identity, new string[] {}) {

			this.user = user;

		}
예제 #2
0
 public UserEdit(UserWithPermissionsContract contract)
     : this()
 {
     Active = contract.Active;
     GroupId = contract.GroupId;
     Id = contract.Id;
     Name = contract.Name;
     OwnedArtists = contract.OwnedArtistEntries;
     Permissions = PermissionToken.All
         .Select(p => new PermissionFlagEntry(p, contract.AdditionalPermissions.Contains(p), contract.EffectivePermissions.Contains(p))).ToArray();
 }
예제 #3
0
		public static void SetLoggedUser(UserWithPermissionsContract user) {

			ParamIs.NotNull(() => user);

			if (!HttpContext.Current.User.Identity.IsAuthenticated)
				throw new InvalidOperationException("Must be authenticated");

			HttpContext.Current.User = new VocaDbPrincipal(HttpContext.Current.User.Identity, user);

		}