casbin icon indicating copy to clipboard operation
casbin copied to clipboard

hasPolicy can not get policy bug hasNamedPolicy

Open only21tender opened this issue 1 year ago • 2 comments

use version: casbin/casbin/v2 v2.89.0 go version 1.22

describe: while I use hasPolicy func to get policies in mysql,the bool result return always is false and I try hasNamedPolicy func to get policy , it can be return right result

ex: (debug logs) hasPolicy {"aclExits":false,"err":null,"file":"logs.go","func":"cmp/logs.Debug","level":"debug","msg":"debug for test get hasPolicyfunc","time":"2024-06-25 07:43:13"} hasNamedPolicy {"aclExits":true,"err":null,"file":"logs.go","func":"cmp/logs.Debug","level":"debug","msg":"debug for test get hasNamedPolicy","time":"2024-06-25 07:45:10"}

only21tender avatar Jun 24 '24 23:06 only21tender

@tangyang9464 @JalinWang

casbin-bot avatar Jun 24 '24 23:06 casbin-bot

Please provide a reproduction, including your model, policy, and code

MuZhou233 avatar Jun 26 '24 23:06 MuZhou233

Closed as stale

hsluoyz avatar Aug 19 '24 11:08 hsluoyz