Skip to content

Commit

Permalink
feature WS-579: added log lines to the auth initializer
Browse files Browse the repository at this point in the history
* made it so that the auth initializer would check if a user is nil first before adding it to the policy
  • Loading branch information
IshikaGopie committed Mar 18, 2024
1 parent ccc99a4 commit fc45095
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/rest/operation_initializers.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ m = r.sub == p.sub && keyMatch(r.obj, p.obj) && regexMatch(r.act, p.act)
var success bool
success, err = enforcer.AddPolicy(user.(string), path, method)
if !success {
log.Warnf("unable to add policy for user '%s' on path '%s' for method '%s'", user, path, method)
//TODO show warning to developer or something
}
}
}
Expand All @@ -105,7 +105,7 @@ m = r.sub == p.sub && keyMatch(r.obj, p.obj) && regexMatch(r.act, p.act)
}
success, err = enforcer.AddPolicy(user.(string), path, method)
if !success {
log.Warnf("unable to add policy for role '%s' on path '%s' for method '%s'", user, path, method)
//TODO show warning to developer or something
}
}
}
Expand Down

0 comments on commit fc45095

Please sign in to comment.