Skip to content

Request help: confused in the code snippet of Adapter.lua #136

Description

@starsz

Hello,
When I use the authz-casbin plugin in Apache APISIX with a large policy, I found that the method of newEnforcerFromText takes a long time (about 40s).

After digging into it, the code below confused me:

https://github.com/casbin/lua-casbin/blob/249ae23a23d1be74762c7f3e25e5685e61b6e2d6/src/persist/Adapter.lua#L42-L56

  1. Do we need to traverse model.model[sec][key].policy again of line~53.
  2. Is there any way to improve this function?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions