This commit is contained in:
苏尹岚
2021-01-22 10:31:41 +08:00
parent a1ddba2c78
commit 618ae4c251
2 changed files with 19 additions and 12 deletions

View File

@@ -359,3 +359,14 @@ func GetUserStoresResultMap(userID string) (resultMap map[int]int, err error) {
}
return resultMap, err
}
func IsRoled(ctx *jxcontext.Context) bool {
if ctx.GetUserName() != "jxadmin" {
if user, err := dao.GetUserByID(dao.GetDB(), "user_id", ctx.GetUserID()); err == nil {
if user.Type&model.UserTypeRole != 0 {
return true
}
}
}
return false
}