public ClientPermissionsActionResult(IViewService viewSvc, IDictionary<string, object> env, ClientPermissionsViewModel model)
     : base(async () => await viewSvc.ClientPermissions(model))
 {
     if (viewSvc == null) throw new ArgumentNullException("viewSvc");
     if (env == null) throw new ArgumentNullException("env");
     if (model == null) throw new ArgumentNullException("model");
 }
 private async Task<IHttpActionResult> RenderPermissionsPage(string error = null)
 {
     var env = Request.GetOwinEnvironment();
     var clients = await this.clientPermissionsService.GetClientPermissionsAsync(User.GetSubjectId());
     var vm = new ClientPermissionsViewModel
     {
         RequestId = env.GetRequestId(),
         SiteName = options.SiteName,
         SiteUrl = env.GetIdentityServerBaseUrl(),
         CurrentUser = User.GetName(),
         LogoutUrl = env.GetIdentityServerLogoutUrl(),
         RevokePermissionUrl = Request.GetOwinContext().GetPermissionsPageUrl(),
         AntiForgery = antiForgeryToken.GetAntiForgeryToken(),
         Clients = clients,
         ErrorMessage = error
     };
     return new ClientPermissionsActionResult(this.viewSvc, Request.GetOwinEnvironment(), vm);
 }
 /// <summary>
 /// Loads the HTML for the client permissions page.
 /// </summary>
 /// <param name="model">The model.</param>
 /// <returns>
 /// Stream for the HTML
 /// </returns>
 public Task<Stream> ClientPermissions(ClientPermissionsViewModel model)
 {
     return Render(model, "permissions");
 }
 private async Task<IHttpActionResult> RenderPermissionsPage(string error = null)
 {
     var env = Request.GetOwinEnvironment();
     var clients = await this.clientPermissionsService.GetClientPermissionsAsync(User.GetSubjectId());
     var vm = new ClientPermissionsViewModel
     {
         SiteName = options.SiteName,
         SiteUrl = env.GetIdentityServerBaseUrl(),
         CurrentUser = User.GetName(),
         LogoutUrl = Url.Link(Constants.RouteNames.Logout, null),
         RevokePermissionUrl = Url.Link(Constants.RouteNames.ClientPermissions, null),
         AntiForgery = AntiForgeryTokenValidator.GetAntiForgeryHiddenInput(env),
         Clients = clients,
         ErrorMessage = error
     };
     return new ClientPermissionsActionResult(this.viewSvc, Request.GetOwinEnvironment(), vm);
 }