add models.user.i18n (#504)

This commit is contained in:
yubo 2021-01-12 20:27:49 +08:00 committed by GitHub
parent 903a1654b6
commit 74545012ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 4 deletions

1
etc/plugins/mongodb.yml Normal file
View File

@ -0,0 +1 @@
mode: overlay

1
etc/plugins/redis.yml Normal file
View File

@ -0,0 +1 @@
mode: overlay

View File

@ -411,18 +411,18 @@ func (u *User) CanModifyTeam(t *Team) (bool, error) {
func (u *User) CheckPermByNode(node *Node, operation string) {
if node == nil {
errors.Bomb("node is nil")
errors.Bomb(_s("node is nil"))
}
if operation == "" {
errors.Bomb("operation is blank")
errors.Bomb(_s("operation is blank"))
}
has, err := u.HasPermByNode(node, operation)
errors.Dangerous(err)
if !has {
errors.Bomb("no privilege")
errors.Bomb(_s("no privilege"))
}
}
@ -477,7 +477,7 @@ func (u *User) CheckPermGlobal(operation string) {
errors.Dangerous(err)
if !has {
errors.Bomb("no privilege")
errors.Bomb(_s("no privilege"))
}
}

View File

@ -123,6 +123,9 @@ var (
"Invalid user status %d": "异常的用户状态 %d",
"Password expired, please change the password in time": "密码过期,请及时修改密码",
"First Login, please change the password in time": "初始登陆,请及时修改密码",
"no privilege": "privilege 未设置",
"node is nil": "node 未设置",
"operation is blank": "operation 未设置",
},
}
)