php-casbin / laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.
Apache License 2.0
272 stars 46 forks source link

¿Multiple policy definition? #52

Closed bpuig closed 1 year ago

bpuig commented 1 year ago

Hello, I'm on a situation that sometimes I have more parameters for the policies, can this be made like in documentation? I can't figure out the way to make it work. It always tells me I provided less parameters.

[policy_definition] p = sub, obj, act p2 = sub, act

Thanks

hsluoyz commented 1 year ago

@bpuig why close?

hsluoyz commented 1 year ago

@leeqvip

bpuig commented 1 year ago

The package won, I was unable to figure anything out about multiple policies and matchers and now my brain is melt 😩

hsluoyz commented 1 year ago

@bpuig we recommend using only one p, for your p2, you can leave the obj empty

bpuig commented 1 year ago

And any suggestion on how to eval() an object? It only allows strings as parameters. Thanks in advance, I've had 2 rough days trying to figure out how everything works

leeqvip commented 1 year ago

@bpuig I recommend you to refer to this tutorial to get started: https://github.com/php-casbin/casbin-tutorials