public async Task UpdateScopesAsync(UpdateScopeInputDo input)
        {
            if (input.BeforeName != input.Scope.Name)
            {
                // scope需要保持系统唯一,否则报错
                var exist = _apiScopeRepository.Count(e => e.Name == input.Scope.Name) > 0;
                if (exist)
                {
                    throw new UserFriendlyException("已存在同名scope,scope需要保证跨资源唯一");
                }
            }

            // 先删除后插入
            await this.DeleteScopesAsync(input.BeforeApiResourceId, input.BeforeName);

            await this.AddScopesAsync(input.Scope);
        }
Example #2
0
 public async Task UpdateScopesAsync(UpdateScopeInputDo input)
 {
     await this._apiResourceAppService.UpdateScopesAsync(input);
 }