public PushResponseBuilder(ISession session, PushRequest pushRequest, IAccessControlLists acls) { this.session = session; this.pushRequest = pushRequest; this.acls = acls; this.metaPopulation = this.session.Database.MetaPopulation; }
public ActionResult <PushResponse> Post([FromBody] PushRequest request) => this.PolicyService.PushPolicy.Execute( () => { try { using (var session = this.DatabaseService.Database.CreateSession()) { var acls = new WorkspaceAccessControlLists(session.GetUser()); var responseBuilder = new PushResponseBuilder(session, request, acls); var response = responseBuilder.Build(); return(response); } } catch (Exception e) { this.Logger.LogError(e, "PushRequest {request}", request); throw; } });
public IActionResult Push([FromBody] PushRequest pushRequest) { try { return(this.PolicyService.PushPolicy.Execute( () => { using (var session = this.DatabaseService.Database.CreateSession()) { var responseBuilder = new PushResponseBuilder(session, session.GetUser(), pushRequest); var response = responseBuilder.Build(); return this.Ok(response); } })); } catch (Exception e) { this.Logger.LogError(e, "Exception"); return(this.StatusCode(500, e.Message)); } }
public PushResponseBuilder(ISession session, User user, PushRequest pushRequest) { this.session = session; this.user = user; this.pushRequest = pushRequest; }