public async Task <bool> Validate(IDictionary <string, string> routeValues, HttpMethod httpMethod)
        {
            var permissions = await _permissionResolver.Resolve(_loginInfo.UserId, _loginInfo.Platform);

            var area       = routeValues["area"];
            var controller = routeValues["controller"];
            var action     = routeValues["action"];

            return(permissions.Any(m => m.EqualsIgnoreCase($"{area}_{controller}_{action}_{httpMethod}")));
        }
Пример #2
0
        public async Task <bool> Validate(IDictionary <string, string> routeValues, HttpMethod httpMethod)
        {
            return(true);

            //var permissions =await _rolePermissionRepository.QueryByAccount(_loginInfo.Uid);

            var permissions = await _permissionResolver.Resolve(_loginInfo.Uid);

            var area       = routeValues["area"];
            var controller = routeValues["controller"];
            var action     = routeValues["action"];

            return(permissions.Any(m => m.EqualsIgnoreCase($"{area}_{controller}_{action}_{httpMethod}")));
        }