Validation issues in Restful routing style
zhengzhishanliang opened this issue · 5 comments
@zhengzhishanliang
This is related to the priority of the policy. It works fine in your editor because this policy is hit first:
p, admin, domain1, /api/admins/permissions, get
If you move the (p, admin, domain1, /api/admins/permissions, *) policy to the front and make it a higher priority, it will also generate an error. because * is not a valid regular expression .
see: https://casbin.org/casbin-editor/#BNLXPXAK7

@leeqvip 由衷表示感谢!Thank you very much! you solved my problem.
Allow me to ask an additional question:
I want to have both * and GET data for the same url, for example, "alice,/orders,*" means that alice can request /orders for GET/POST and /orders/:id for GET /PUT/DELETE. "bob ,/orders,GET" means that bob can only request /orders by GET.
For this case, I can't use *, then how should I structure my data.
Thanks again!
alice, /orders, (get|post)
@leeqvip thanks !





