修改权限判断
This commit is contained in:
@@ -1255,6 +1255,12 @@ func GetUserStoreAuth(ctx *jxcontext.Context, storeID int) (outStoreID int, err
|
|||||||
}
|
}
|
||||||
return storeID, nil
|
return storeID, nil
|
||||||
}
|
}
|
||||||
|
//storeMap, _ := permission.GetUserStoresResultMap(ctx.GetUserID())
|
||||||
|
//if storeMap[storeID] != 0 {
|
||||||
|
// return storeID, err
|
||||||
|
//} else {
|
||||||
|
// return 0, err
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
return storeID, err
|
return storeID, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -382,7 +382,12 @@ 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 {
|
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
|
||||||
|
//}
|
||||||
|
if user.Type == 23 {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user