public VocaDbPrincipal(IIdentity identity, UserWithPermissionsContract user) : base(identity, new string[] {}) { this.user = user; }
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(); }
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); }