refactor platform domain states and permissions
This commit is contained in:
@@ -22,11 +22,11 @@ const (
|
||||
// InitPlatformAccess 幂等初始化 root 角色;菜单定义位于逻辑层静态数据中。
|
||||
func InitPlatformAccess(database *gorm.DB) error {
|
||||
rootRole := models.PlatformRole{
|
||||
Entity: models.Entity{Identity: models.NewIdentity(), Status: common.StatusEnable},
|
||||
RoleCode: PlatformRootRoleCode,
|
||||
Name: "系统管理员",
|
||||
DataScope: "global",
|
||||
IsSystem: true,
|
||||
Entity: models.Entity{Identity: models.NewIdentity(), Status: common.StatusEnable},
|
||||
RoleCode: PlatformRootRoleCode,
|
||||
Name: "系统管理员",
|
||||
LocationScope: "precise",
|
||||
IsSystem: true,
|
||||
}
|
||||
return database.Where("role_code = ?", rootRole.RoleCode).FirstOrCreate(&rootRole).Error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user