aa
This commit is contained in:
@@ -413,3 +413,12 @@ func IsRoled(ctx *jxcontext.Context) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func IsRoledByUserID(userID string) bool {
|
||||
if user, err := dao.GetUserByID(dao.GetDB(), "user_id", userID); err == nil {
|
||||
if user.Type&model.UserTypeRole != 0 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user