casbin / casbin

An authorization library that supports access control models like ACL, RBAC, ABAC in Golang: https://discord.gg/S5UjpzGZjN
https://casbin.org
Apache License 2.0
17.78k stars 1.65k forks source link

Casbin PML Interpreter #274

Closed benwilson512 closed 5 years ago

benwilson512 commented 5 years ago

Hey folks!

I apologize if this is in the wrong place. The Casbin paper from earlier this year speaks about a Lua based PML interpreter, but none of the various language implementations seem to use a Lua interpreter, and the casbin-lua project is basically empty. Is Lua not part of casbin any more? Is the code for the Lua based interpreter still around anywhere?

Thanks!

hsluoyz commented 5 years ago

See: https://github.com/casbin/pycasbin/issues/19

benwilson512 commented 5 years ago

Hi @hsluoyz thanks for linking that issue. The main reason I am interested in the Lua code is that I'm trying to use Casbin within a language that already has a Lua interpreter, but is does not yet have a dedicated Casbin implementation.

If the Lua code referenced in the paper were open source, any language with a lua interpreter would be able make use of Casbin without the complexity of dedicated enforcer / evaluator code. In fact the paper itself makes a compelling argument for Lua throughout.

The paper is just for reference.

That's fair, but as far as I can tell none of the currently open source options actually implement this reference. Using govaluate or hard coding functions https://github.com/casbin/jcasbin/blob/master/src/main/java/org/casbin/jcasbin/model/FunctionMap.java is not the same thing as having a PML interpreter.

If the Lua implementation isn't production ready yet that's fine, that's the point of open source.

hsluoyz commented 5 years ago

The main reason I am interested in the Lua code is that I'm trying to use Casbin within a language that already has a Lua interpreter

What language do you work on? Elixir or Ruby?

benwilson512 commented 5 years ago

Elixir / Erlang.

hsluoyz commented 4 years ago

@benwilson512 Casbin already has a native Elixir implementation: https://github.com/casbin/casbin-ex

benwilson512 commented 4 years ago

It did not at the time I posted this issue. I'm glad it has one now, although I still think there is value to a canonical Lua based implementation would make it easier to bootstrap future languages.

hsluoyz commented 4 years ago

@benwilson512 We will consider to make a new Lua implementation these months: https://github.com/casbin/casbin-lua Maybe let a GSoC student work on it next summer.