Skip to content

Commit

Permalink
https://github.com/Starcounter/HeadsOmni/issues/879
Browse files Browse the repository at this point in the history
  • Loading branch information
habib535 committed Mar 8, 2019
1 parent 3348c3a commit 59d0f7f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public Action<IApplicationBuilder> Configure(Action<IApplicationBuilder> next)
return null;
}
Session.Ensure();
_authCookieService.ReattachOrCreate(request.Cookies);
return null;
Expand Down
2 changes: 0 additions & 2 deletions Authorization/Middleware/SecurityMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ IAuthenticationTicketService<TUserAuthenticationTicket> authenticationTicketServ

public Response Run(RoutingInfo routingInfo, Func<Response> next)
{
_pageSecurity.EnhanceClass(routingInfo.SelectedPageType);

if (!_pageSecurity.CheckClass(routingInfo.SelectedPageType, routingInfo.Context).Result)
{
if (!routingInfo.Request.IsExternal)
Expand Down
10 changes: 9 additions & 1 deletion Authorization/PageSecurity/PageSecurity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ public async Task<bool> CheckClass(Type pageType, object context)
{
// todo cache
Func<object, Task<bool>> check = _checkersCreator.CreateBoolCheck(pageType);
return check == null || await check(context);
if (check == null)
{
return true;
}
else
{
EnhanceClass(pageType);
return await check(context);
}
}

private void AddHandlers(IEnumerable<Tuple<MethodInfo, Template, Check, Type>> allHandlersTasks)
Expand Down

0 comments on commit 59d0f7f

Please sign in to comment.