wip: 结构感觉还是要调整
This commit is contained in:
11
rbac/rbac.go
11
rbac/rbac.go
@ -24,6 +24,7 @@ func New(opts ...Option) (*Urbac, error) {
|
||||
rootPrivilege *model.Privilege
|
||||
rootRole *model.Role
|
||||
rootScope *model.Scope
|
||||
rootUser *model.User
|
||||
)
|
||||
|
||||
for _, opt := range opts {
|
||||
@ -60,5 +61,15 @@ func New(opts ...Option) (*Urbac, error) {
|
||||
}
|
||||
}
|
||||
|
||||
rootUser = &model.User{
|
||||
Username: "admin",
|
||||
Password: tool.NewPassword("123456"),
|
||||
Status: model.StatusActive,
|
||||
Nickname: "管理员",
|
||||
RoleNames: []string{"admin"},
|
||||
}
|
||||
|
||||
u.newUser()
|
||||
|
||||
return u, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user