Skip to content

Commit

Permalink
Merge pull request #3178 from gravitl/NET-1732
Browse files Browse the repository at this point in the history
fix all networks user grp
  • Loading branch information
abhishek9686 authored Nov 4, 2024
2 parents 3448d63 + c07b32d commit 7dcc866
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion logic/acls.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func GetDefaultPolicy(netID models.NetworkID, ruleType models.AclPolicyType) (mo
}
if policy.RuleType == ruleType {
dstMap := convAclTagToValueMap(policy.Dst)
srcMap := convAclTagToValueMap(policy.Dst)
srcMap := convAclTagToValueMap(policy.Src)
if _, ok := srcMap["*"]; ok {
if _, ok := dstMap["*"]; ok {
return policy, nil
Expand Down
5 changes: 5 additions & 0 deletions pro/logic/user_mgmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,13 +640,18 @@ func GetUserNetworkRolesWithRemoteVPNAccess(user models.User) (gwAccess map[mode
}
if _, ok := user.NetworkRoles[models.AllNetworks]; ok {
gwAccess[models.NetworkID("*")] = make(map[models.RsrcID]models.RsrcPermissionScope)
return
}
if len(user.UserGroups) > 0 {
for gID := range user.UserGroups {
userG, err := GetUserGroup(gID)
if err != nil {
continue
}
if _, ok := userG.NetworkRoles[models.AllNetworks]; ok {
gwAccess[models.NetworkID("*")] = make(map[models.RsrcID]models.RsrcPermissionScope)
return
}
for netID, roleMap := range userG.NetworkRoles {
for roleID := range roleMap {
role, err := logic.GetRole(roleID)
Expand Down

0 comments on commit 7dcc866

Please sign in to comment.