鉴权调整
This commit is contained in:
parent
c1c5bbe0e2
commit
cc4a840732
|
@ -113,7 +113,7 @@ func (l *Ldap) VerifyAuthorityGroup(r *http.Request, options ...LdapOptions) boo
|
||||||
logx.Error("系统出错", err)
|
logx.Error("系统出错", err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
getAllApis(metadata, &apiMaps)
|
getAllMetadata(metadata, "api", &apiMaps)
|
||||||
c.Set(groupKey, apiMaps, 5*time.Minute)
|
c.Set(groupKey, apiMaps, 5*time.Minute)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,14 +125,14 @@ func (l *Ldap) VerifyAuthorityGroup(r *http.Request, options ...LdapOptions) boo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getAllApis(metadata []*GroupAuthMetadata, apiMaps *map[int64]string) {
|
func getAllMetadata(metadata []*GroupAuthMetadata, dataType string, maps *map[int64]string) {
|
||||||
apiMapsData := *apiMaps
|
apiMapsData := *maps
|
||||||
for _, v := range metadata {
|
for _, v := range metadata {
|
||||||
if v != nil {
|
if v != nil {
|
||||||
if v.Type == "api" {
|
if v.Type == dataType {
|
||||||
apiMapsData[v.Id] = v.Name
|
apiMapsData[v.Id] = v.Name
|
||||||
} else if v.Type == "group" {
|
} else if v.Type == "group" {
|
||||||
getAllApis(v.Metadata, apiMaps)
|
getAllMetadata(v.Metadata, dataType, maps)
|
||||||
} else {
|
} else {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user