Commit a0806d53 authored by shajiaiming's avatar shajiaiming

权限 过滤

parent d4fc50ed
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
"bwallet/service/platform_chain_service" "bwallet/service/platform_chain_service"
"bwallet/service/recommend_coin_service" "bwallet/service/recommend_coin_service"
"bwallet/validate_service" "bwallet/validate_service"
"fmt"
"github.com/Unknwon/com" "github.com/Unknwon/com"
"github.com/astaxie/beego/validation" "github.com/astaxie/beego/validation"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
...@@ -230,25 +231,8 @@ func EditCoin(c *gin.Context) { ...@@ -230,25 +231,8 @@ func EditCoin(c *gin.Context) {
coin_exist, _ := coin_model.Get() coin_exist, _ := coin_model.Get()
platformChainService := platform_chain_service.PlatformChain{
PlatformId: auth.PlatformId,
IsPrimary: 1,
}
platform_chain, err := platformChainService.GetAll()
if err != nil {
handler.SendResponse(c, errno.InternalServerError, nil)
return
}
var platform string
for _, val := range platform_chain {
if nil != val.ChainInfo {
platform = val.ChainInfo.Platform
}
}
if ("administrator" != group) { if ("administrator" != group) {
if (strings.ToUpper(coin_exist.Platform) != strings.ToUpper(platform)) { if (strings.ToUpper(coin_exist.Platform) != strings.ToUpper(coin.Platform)) {
handler.SendResponse(c, errno.ErrAuthCoin, nil) handler.SendResponse(c, errno.ErrAuthCoin, nil)
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment