Skip to content

Commit 9654fe1

Browse files
committed
resolved #83
1 parent 85e66c2 commit 9654fe1

File tree

3 files changed

+5
-23
lines changed

3 files changed

+5
-23
lines changed

aspnet-core/src/AbpCompanyName.AbpProjectName.Application/MultiTenancy/TenantAppService.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
namespace AbpCompanyName.AbpProjectName.MultiTenancy
1919
{
20+
[AbpAuthorize(PermissionNames.Pages_Tenants)]
2021
public class TenantAppService : AsyncCrudAppService<Tenant, TenantDto, int, PagedResultRequestDto, CreateTenantDto, TenantDto>, ITenantAppService
2122
{
2223
private readonly TenantManager _tenantManager;
@@ -44,14 +45,6 @@ IPasswordHasher<User> passwordHasher
4445
_abpZeroDbMigrator = abpZeroDbMigrator;
4546
_passwordHasher = passwordHasher;
4647
_userManager = userManager;
47-
48-
//todo@ismail: move to AbpAuthorize attribute when this is resolved https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2253
49-
CreatePermissionName
50-
= GetAllPermissionName
51-
= GetPermissionName
52-
= UpdatePermissionName
53-
= DeletePermissionName
54-
= PermissionNames.Pages_Tenants;
5548
}
5649

5750
public override async Task<TenantDto> Create(CreateTenantDto input)
@@ -118,7 +111,7 @@ public override async Task Delete(EntityDto<int> input)
118111
await _tenantManager.DeleteAsync(tenant);
119112
}
120113

121-
protected virtual void CheckErrors(IdentityResult identityResult)
114+
private void CheckErrors(IdentityResult identityResult)
122115
{
123116
identityResult.CheckErrors(LocalizationManager);
124117
}

aspnet-core/src/AbpCompanyName.AbpProjectName.Application/Roles/RoleAppService.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
namespace AbpCompanyName.AbpProjectName.Roles
1818
{
19+
[AbpAuthorize(PermissionNames.Pages_Roles)]
1920
public class RoleAppService : AsyncCrudAppService<Role, RoleDto, int, PagedResultRequestDto, CreateRoleDto, RoleDto>, IRoleAppService
2021
{
2122
private readonly RoleManager _roleManager;
@@ -24,13 +25,6 @@ public class RoleAppService : AsyncCrudAppService<Role, RoleDto, int, PagedResul
2425
public RoleAppService(IRepository<Role> repository, RoleManager roleManager, UserManager userManager)
2526
: base(repository)
2627
{
27-
//todo@ismail: move to AbpAuthorize attribute when this is resolved https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2253
28-
CreatePermissionName
29-
= GetAllPermissionName
30-
= GetPermissionName
31-
= UpdatePermissionName
32-
= DeletePermissionName = PermissionNames.Pages_Roles;
33-
3428
_roleManager = roleManager;
3529
_userManager = userManager;
3630
}

aspnet-core/src/AbpCompanyName.AbpProjectName.Application/Users/UserAppService.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
using AbpCompanyName.AbpProjectName.Users.Dto;
99
using Microsoft.AspNetCore.Identity;
1010
using System.Linq;
11+
using Abp.Authorization;
1112
using Microsoft.EntityFrameworkCore;
1213
using Abp.IdentityFramework;
1314
using AbpCompanyName.AbpProjectName.Authorization.Roles;
1415
using AbpCompanyName.AbpProjectName.Roles.Dto;
1516

1617
namespace AbpCompanyName.AbpProjectName.Users
1718
{
19+
[AbpAuthorize(PermissionNames.Pages_Users)]
1820
public class UserAppService : AsyncCrudAppService<User, UserDto, long, PagedResultRequestDto, CreateUserDto, UserDto>, IUserAppService
1921
{
2022
private readonly UserManager _userManager;
@@ -24,13 +26,6 @@ public class UserAppService : AsyncCrudAppService<User, UserDto, long, PagedResu
2426
public UserAppService(IRepository<User, long> repository, UserManager userManager, IPasswordHasher<User> passwordHasher, IRepository<Role> roleRepository)
2527
: base(repository)
2628
{
27-
//todo@ismail: move to AbpAuthorize attribute when this is resolved https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2253
28-
CreatePermissionName
29-
= GetAllPermissionName
30-
= GetPermissionName
31-
= UpdatePermissionName
32-
= DeletePermissionName = PermissionNames.Pages_Users;
33-
3429
_userManager = userManager;
3530
_passwordHasher = passwordHasher;
3631
_roleRepository = roleRepository;

0 commit comments

Comments
 (0)