From c0396abf8c91334b0e7d47ed0b8358310bce2dd6 Mon Sep 17 00:00:00 2001 From: hzwy23 Date: Wed, 28 Jun 2017 21:44:02 +0800 Subject: [PATCH] update views --- hauth/hrpc/auth.go | 7 +++++++ hauth/models/domainShareModels.go | 7 ++++++- views/hauth/domain_share_info.tpl | 17 +++++++++-------- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/hauth/hrpc/auth.go b/hauth/hrpc/auth.go index 0e44266..3a58472 100644 --- a/hauth/hrpc/auth.go +++ b/hauth/hrpc/auth.go @@ -64,3 +64,10 @@ func DomainAuth(req *http.Request, domain_id string, pattern string) bool { return false } } + +func IsRoot(domainId string) bool { + if domainId == "vertex_root" { + return true + } + return false +} diff --git a/hauth/models/domainShareModels.go b/hauth/models/domainShareModels.go index 9a355c1..da4f845 100644 --- a/hauth/models/domainShareModels.go +++ b/hauth/models/domainShareModels.go @@ -4,6 +4,7 @@ import ( "errors" "net/url" + "github.com/hzwy23/asofdate/hauth/hrpc" "github.com/hzwy23/dbobj" "github.com/hzwy23/utils/logs" "github.com/hzwy23/utils/validator" @@ -147,6 +148,11 @@ func (this DomainShareModel) GetList(domain_id string) ([]DomainMmodel, error) { logs.Error(err) return nil, err } + var dslice []DomainMmodel + + if hrpc.IsRoot(domain_id) { + return rst, nil + } // 获取指定域能够访问到的域信息 ret, err := this.get(domain_id) @@ -161,7 +167,6 @@ func (this DomainShareModel) GetList(domain_id string) ([]DomainMmodel, error) { dmap[val.Project_id] = true } - var dslice []DomainMmodel for _, val := range rst { if _, ok := dmap[val.Project_id]; ok && val.Domain_status_cd == "0" { dslice = append(dslice, val) diff --git a/views/hauth/domain_share_info.tpl b/views/hauth/domain_share_info.tpl index a0d1123..ef3819e 100644 --- a/views/hauth/domain_share_info.tpl +++ b/views/hauth/domain_share_info.tpl @@ -3,7 +3,6 @@ 域信息共享配置管理 -