/// <summary> /// /// </summary> /// <param name="serviceProvider"></param> /// <param name="context"></param> /// <param name="uid"></param> /// <returns></returns> protected override async Task VailOfRole( IServiceProvider serviceProvider, AuthorizationHandlerContext context, string uid) { if (context.Resource is not DefaultHttpContext httpContext) { return; } var res = httpContext.GetEndpoint(); var routePattern = httpContext.GetRouteData().Values; var module = res.Metadata.GetMetadata <RuleModuleAttribute>(); var method = res.Metadata.GetMetadata <RuleMethodAttribute>(); if (module == null && method == null) { context.Succeed(this); return; } UsersContext usersContext = await UsersContext.GetInfo( serviceProvider, uid); string area = routePattern.ContainsKey("area") ? routePattern["area"].ToStringEx() : ""; if (await Rule.IsRule_NSpecial( serviceProvider, await EnterpriseContext.GetInfo(serviceProvider, ClaimsPrincipalEx.FindFirstValueEx(context.User, Macro.COOKIESLOGIN_EID)), usersContext, ConvertEx.ToStringEx(routePattern["controller"]), area, ConvertEx.ToStringEx(routePattern["action"]))) { context.Succeed(this); } }