Skip to content

Commit

Permalink
adds comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nickzelei committed Nov 13, 2024
1 parent 2d418b2 commit 349d918
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/ee/rbac/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ func (r *Rbac) InitPolicies(
}

func setPolicy(e casbin.IEnforcer, policy []string) error {
// AddPoliciesEx is what should be uesd here but is resulting in duplicates
// This logic here seems to handle this instead
// AddPoliciesEx is what should be uesd here but is resulting in duplicates (and errors with unique constraint)
// AddPolicies handles the unique constraint but fails if even one policy already exists..

// This logic here seems to handle what I want it to do instead strangely...
ok, err := e.HasPolicy(policy)
if err != nil {
return fmt.Errorf("unable to check if policy exists: %w", err)
Expand Down

0 comments on commit 349d918

Please sign in to comment.