Skip to content

Commit

Permalink
Make key level tags in order and unique (#2475)
Browse files Browse the repository at this point in the history
  • Loading branch information
buger committed Sep 24, 2019
1 parent 598a8dc commit eb18a1f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,13 @@ func (t BaseMiddleware) ApplyPolicies(session *user.SessionState) error {
}
}

// set tags
if len(tags) > 0 {
for tag := range tags {
session.Tags = append(session.Tags, tag)
}
for _, tag := range session.Tags {
tags[tag] = true
}

session.Tags = []string{}
for tag, _ := range tags {
session.Tags = append(session.Tags, tag)
}

session.AccessRights = rights
Expand Down

0 comments on commit eb18a1f

Please sign in to comment.