public override void OnActionExecuting(ActionExecutingContext context) { InitializeServices(context); if (!RoleValidator.ValidatePermissions(context.HttpContext.User, Roles)) { context.Result = new UnauthorizedResult(); } }