Skip to content

Commit

Permalink
feat: 因Vue3权限组件调整,修改接口Policy
Browse files Browse the repository at this point in the history
  • Loading branch information
WangJunZzz committed Apr 21, 2023
1 parent 50eab11 commit 2fb25af
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Lion.AbpPro.BasicManagement.AuditLogs
{
[Authorize]
[Authorize(Policy = BasicManagementPermissions.SystemManagement.AuditLog)]
public class AuditLogAppService : BasicManagementAppService, IAuditLogAppService
{
private readonly IAuditLogRepository _auditLogRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Lion.AbpPro.BasicManagement.OrganizationUnits;

[Authorize]
[Authorize(Policy = BasicManagementPermissions.SystemManagement.OrganizationUnitManagement.Default)]
public class OrganizationUnitAppService : BasicManagementAppService, IOrganizationUnitAppService
{
private readonly OrganizationUnitManager _organizationUnitManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Lion.AbpPro.BasicManagement.Roles;

[Authorize]
[Authorize(Policy = IdentityPermissions.Roles.Default)]
public class RoleAppService : BasicManagementAppService, IRoleAppService
{
private readonly IIdentityRoleAppService _identityRoleAppService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,24 @@ public RolePermissionAppService(IPermissionAppService rolePermissionAppService,
/// <summary>
/// 获取所有权限
/// </summary>
/// <returns></returns>
public async Task<PermissionOutput> GetPermissionAsync(GetPermissionInput input)
{
var permissions =
await _rolePermissionAppService.GetAsync(input.ProviderName, input.ProviderKey);
var permissions = await _rolePermissionAppService.GetAsync(input.ProviderName, input.ProviderKey);
return BuildTreeData(permissions.Groups);
}

/// <summary>
/// 更新权限
/// </summary>
/// <param name="input"></param>
[Authorize(IdentityPermissions.Roles.ManagePermissions)]
public async Task UpdatePermissionAsync(UpdateRolePermissionsInput input)
{
await _rolePermissionAppService.UpdateAsync(input.ProviderName, input.ProviderKey,
input.UpdatePermissionsDto);
await _rolePermissionAppService.UpdateAsync(input.ProviderName, input.ProviderKey, input.UpdatePermissionsDto);
}

/// <summary>
/// 生成权限树
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
private PermissionOutput BuildTreeData(List<PermissionGroupDto> input)
{
var result = new PermissionOutput();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Lion.AbpPro.BasicManagement.Tenants
{
[Authorize]
[Authorize(TenantManagementPermissions.Tenants.Default)]
public class VoloTenantAppService : BasicManagementAppService, IVoloTenantAppService
{
private readonly IAbpTenantAppService _abpTenantAppService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
using Lion.AbpPro.BasicManagement.Localization;
using Lion.AbpPro.BasicManagement.Users.Dtos;
using Magicodes.ExporterAndImporter.Excel;
using Magicodes.ExporterAndImporter.Excel.AspNetCore;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Account;
using Volo.Abp.Identity.Localization;
using IdentityRole = Volo.Abp.Identity.IdentityRole;

namespace Lion.AbpPro.BasicManagement.Users
{
[Authorize]
[Authorize(IdentityPermissions.Users.Default)]
public class UserAppService : BasicManagementAppService, IUserAppService
{
private readonly IIdentityUserAppService _identityUserAppService;
Expand Down Expand Up @@ -57,7 +55,6 @@ public async Task<PagedResultDto<IdentityUserDto>> ListAsync(PagingUserListInput
/// <summary>
/// 用户导出列表
/// </summary>
/// <returns></returns>
[Authorize(BasicManagementPermissions.SystemManagement.UserExport)]
public async Task<ActionResult> ExportAsync(PagingUserListInput input)
{
Expand All @@ -78,8 +75,6 @@ public async Task<ActionResult> ExportAsync(PagingUserListInput input)
/// <summary>
/// 新增用户
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[Authorize(IdentityPermissions.Users.Create)]
public async Task<IdentityUserDto> CreateAsync(IdentityUserCreateDto input)
{
Expand All @@ -91,8 +86,6 @@ public async Task<IdentityUserDto> CreateAsync(IdentityUserCreateDto input)
/// <summary>
/// 更新用户
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[Authorize(IdentityPermissions.Users.Update)]
public virtual async Task<IdentityUserDto> UpdateAsync(UpdateUserInput input)
{
Expand All @@ -112,7 +105,6 @@ public virtual async Task DeleteAsync(IdInput input)
/// <summary>
/// 获取用户角色信息
/// </summary>
/// <returns></returns>
public async Task<ListResultDto<IdentityRoleDto>> GetRoleByUserId(IdInput input)
{
var roles = await _identityUserRepository.GetRolesAsync(input.Id);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Lion.AbpPro.DataDictionaryManagement.DataDictionaries
{
[Authorize]
[Authorize(DataDictionaryManagementPermissions.DataDictionaryManagement.Default)]
public class DataDictionaryAppService : DataDictionaryManagementAppService, IDataDictionaryAppService
{
/// <summary>
Expand All @@ -23,8 +23,6 @@ public DataDictionaryAppService(
/// <summary>
/// 分页查询字典项
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<PagedResultDto<PagingDataDictionaryOutput>> GetPagingListAsync(PagingDataDictionaryInput input)
{
var result = new PagedResultDto<PagingDataDictionaryOutput>();
Expand All @@ -43,8 +41,6 @@ public async Task<PagedResultDto<PagingDataDictionaryOutput>> GetPagingListAsync
/// <summary>
/// 分页查询字典项明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<PagedResultDto<PagingDataDictionaryDetailOutput>> GetPagingDetailListAsync(
PagingDataDictionaryDetailInput input)
{
Expand Down Expand Up @@ -73,7 +69,6 @@ public async Task<PagedResultDto<PagingDataDictionaryDetailOutput>> GetPagingDet
/// <summary>
/// 创建字典类型
/// </summary>
/// <returns></returns>
[Authorize(DataDictionaryManagementPermissions.DataDictionaryManagement.Create)]
public Task CreateAsync(CreateDataDictinaryInput input)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Lion.AbpPro.FileManagement.Files;

[Authorize]
[Authorize(FileManagementPermissions.FileManagement.Default)]
public class FileAppService : FileManagementAppService, IFileAppService
{
private readonly IFileManager _fileManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Lion.AbpPro.LanguageManagement.LanguageTexts;
/// <summary>
/// 语言文本
/// </summary>
[Authorize]
[Authorize(LanguageManagementPermissions.LanguageTexts.Default)]
public class LanguageTextAppService : ApplicationService, ILanguageTextAppService
{
private readonly ILanguageTextManager _languageTextManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Lion.AbpPro.LanguageManagement.Languages;
/// <summary>
/// 语言
/// </summary>
[Authorize]
[Authorize(LanguageManagementPermissions.Languages.Default)]
public class LanguageAppService : ApplicationService, ILanguageAppService
{
private readonly ILanguageManager _languageManager;
Expand Down

0 comments on commit 2fb25af

Please sign in to comment.