File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
aspnet-core/src/AbpCompanyName.AbpProjectName.Application Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ public async Task CreateTenant(CreateTenantInput input)
72
72
using ( CurrentUnitOfWork . SetTenantId ( tenant . Id ) )
73
73
{
74
74
//Create static roles for new tenant
75
- await _roleManager . CreateStaticRoles ( tenant . Id ) ;
75
+ CheckErrors ( await _roleManager . CreateStaticRoles ( tenant . Id ) ) ;
76
76
77
77
await CurrentUnitOfWork . SaveChangesAsync ( ) ; //To get static role ids
78
78
@@ -83,11 +83,11 @@ public async Task CreateTenant(CreateTenantInput input)
83
83
//Create admin user for the tenant
84
84
var adminUser = User . CreateTenantAdminUser ( tenant . Id , input . AdminEmailAddress ) ;
85
85
adminUser . Password = _passwordHasher . HashPassword ( adminUser , User . DefaultPassword ) ;
86
- await UserManager . CreateAsync ( adminUser ) ;
86
+ CheckErrors ( await UserManager . CreateAsync ( adminUser ) ) ;
87
87
await CurrentUnitOfWork . SaveChangesAsync ( ) ; //To get admin user's id
88
88
89
89
//Assign admin user to role!
90
- await UserManager . AddToRoleAsync ( adminUser , adminRole . Name ) ;
90
+ CheckErrors ( await UserManager . AddToRoleAsync ( adminUser , adminRole . Name ) ) ;
91
91
await CurrentUnitOfWork . SaveChangesAsync ( ) ;
92
92
}
93
93
}
Original file line number Diff line number Diff line change 2
2
using System . Threading . Tasks ;
3
3
using Abp . Application . Services . Dto ;
4
4
using Abp . Authorization ;
5
- using Abp . AutoMapper ;
6
5
using Abp . Domain . Repositories ;
7
6
using AbpCompanyName . AbpProjectName . Authorization ;
8
7
using AbpCompanyName . AbpProjectName . Authorization . Users ;
@@ -41,7 +40,7 @@ public async Task ProhibitPermission(ProhibitPermissionInput input)
41
40
public async Task RemoveFromRole ( long userId , string roleName )
42
41
{
43
42
var user = await UserManager . FindByIdAsync ( userId . ToString ( ) ) ;
44
- await UserManager . RemoveFromRoleAsync ( user , roleName ) ;
43
+ CheckErrors ( await UserManager . RemoveFromRoleAsync ( user , roleName ) ) ;
45
44
}
46
45
47
46
public async Task < ListResultDto < UserListDto > > GetUsers ( )
@@ -61,7 +60,7 @@ public async Task CreateUser(CreateUserInput input)
61
60
user . Password = _passwordHasher . HashPassword ( user , input . Password ) ;
62
61
user . IsEmailConfirmed = true ;
63
62
64
- await UserManager . CreateAsync ( user ) ;
63
+ CheckErrors ( await UserManager . CreateAsync ( user ) ) ;
65
64
}
66
65
}
67
66
}
You can’t perform that action at this time.
0 commit comments