public PermissionContextAuthorizationHandler(IHttpContextAccessor httpContextAccessor, IDictionary <string, PermissionsContext> permissionsContexts)
        {
            _permissionsContext = new PermissionsContext();

            var requestContext = httpContextAccessor.HttpContext.Request;

            if (requestContext?.Headers.ContainsKey("PermissionsContext") == true &&
                permissionsContexts.TryGetValue(requestContext.Headers["PermissionsContext"], out var permissionsContext))
            {
                _permissionsContext = permissionsContext;
            }
        }
 public PermissionContextAuthorizationHandler(PermissionsContext permissionsContext)
 {
     _permissionsContext = permissionsContext;
 }