1
This commit is contained in:
@@ -384,11 +384,18 @@ func GetUserStoresResultMap(userID string) (resultMap map[int]int, err error) {
|
|||||||
|
|
||||||
func IsRoled(ctx *jxcontext.Context) bool {
|
func IsRoled(ctx *jxcontext.Context) bool {
|
||||||
if ctx.GetUserName() != "jxadmin" {
|
if ctx.GetUserName() != "jxadmin" {
|
||||||
if user, err := dao.GetUserByID(dao.GetDB(), "user_id", ctx.GetUserID()); err == nil {
|
userRole, _ := dao.GetUserRole(dao.GetDB(), []string{ctx.GetUserID()}, nil)
|
||||||
|
for _, v := range userRole {
|
||||||
|
if v.RoleID == model.YES {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
/*if user, err := dao.GetUserByID(dao.GetDB(), "user_id", ctx.GetUserID()); err == nil {
|
||||||
if user.Type&model.UserTypeRole != 0 {
|
if user.Type&model.UserTypeRole != 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user