feat: 默认角色修改为defalut角色
This commit is contained in:
@@ -293,7 +293,7 @@ namespace Yi.Framework.Rbac.Application.Services
|
||||
|
||||
var entity = await _userRepository.InsertReturnEntityAsync(newUser);
|
||||
//赋上一个初始角色
|
||||
var role = await _roleRepository.GetFirstAsync(x => x.RoleCode == UserConst.GuestRoleCode);
|
||||
var role = await _roleRepository.GetFirstAsync(x => x.RoleCode == UserConst.DefaultRoleCode);
|
||||
if (role is not null)
|
||||
{
|
||||
await _userManager.GiveUserSetRoleAsync(new List<Guid> { entity.Id }, new List<Guid> { role.Id });
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Yi.Framework.Rbac.Domain.Shared.Consts
|
||||
public const string AdminRolesCode = "admin";
|
||||
public const string AdminPermissionCode = "*:*:*";
|
||||
|
||||
public const string GuestRoleCode = "guest";
|
||||
public const string DefaultRoleCode = "default";
|
||||
public const string CommonRoleName = "common";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
|
||||
RoleEntity role3 = new RoleEntity()
|
||||
{
|
||||
|
||||
RoleName = "普通用户",
|
||||
RoleName = "普通角色",
|
||||
RoleCode = "common",
|
||||
DataScope = DataScopeEnum.ALL,
|
||||
OrderNum = 1,
|
||||
@@ -56,8 +56,8 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
|
||||
RoleEntity role4 = new RoleEntity()
|
||||
{
|
||||
|
||||
RoleName = "游客用户",
|
||||
RoleCode = "guest",
|
||||
RoleName = "默认角色",
|
||||
RoleCode = "default",
|
||||
DataScope = DataScopeEnum.ALL,
|
||||
OrderNum = 1,
|
||||
Remark = "可简单浏览",
|
||||
|
||||
Reference in New Issue
Block a user