Skip to content

Commit

Permalink
Update apisix/plugins/authz-casbin.lua
Browse files Browse the repository at this point in the history
Co-authored-by: tzssangglass <tzssangglass@gmail.com>
  • Loading branch information
rushitote and tzssangglass committed Aug 3, 2021
1 parent bc7981f commit c15ecf9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apisix/plugins/authz-casbin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ function _M.rewrite(conf, ctx)

local path = ctx.var.uri
local method = ctx.var.method
local username = get_headers()[conf.username]
if not username then username = "anonymous" end
local username = get_headers()[conf.username] or "anonymous"

if conf.casbin_enforcer then
if not conf.casbin_enforcer:enforce(username, path, method) then
Expand Down

0 comments on commit c15ecf9

Please sign in to comment.