add models.user.i18n (#504)
This commit is contained in:
parent
903a1654b6
commit
74545012ed
|
@ -0,0 +1 @@
|
|||
mode: overlay
|
|
@ -0,0 +1 @@
|
|||
mode: overlay
|
|
@ -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"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 未设置",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue