示例#1
0
        protected override async Task <bool> CheckUserPermissions(long userId, IEnumerable <string> codes, string validationVersion)
        {
            //var jwtToken = await _contextAccessor.HttpContext.GetTokenAsync("access_token");
            //var refitResult = await _authRpcService.GetCurrenUserPermissions($"Bearer {jwtToken}", userId, codes);
            var refitResult = await _authRpcService.GetCurrenUserPermissionsAsync(userId, codes, validationVersion);

            if (!refitResult.IsSuccessStatusCode)
            {
                return(false);
            }

            var permissions = refitResult.Content;

            return(permissions.IsNotNullOrEmpty());
        }
        protected override async Task <bool> CheckUserPermissions(long userId, IEnumerable <string> codes)
        {
            //var jwtToken = await _contextAccessor.HttpContext.GetTokenAsync("access_token");
            //var refitResult = await _authRpcService.GetCurrenUserPermissions($"Bearer {jwtToken}", userId, codes);
            var refitResult = await _authRpcService.GetCurrenUserPermissionsAsync(userId, codes);

            if (!refitResult.IsSuccessStatusCode)
            {
                return(false);
            }

            var  permissions = refitResult.Content;
            bool result      = permissions != null && permissions.Any();

            return(result);
        }