You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an application always generates the policy at startup and the policy doesn't change after that at runtime, do we need a persistance layer?
I'd like to do something like: casbin.NewEnforcer(authorizationModelConfig, "")
but that doesnt' work.
I've found the following in the code: if err = e.adapter.LoadPolicy(newModel); err != nil && err.Error() != "invalid file path, file path cannot be empty" { return err }
Execution still fails with "invalid file path, file path cannot be empty".
A workaround is providing an empty, but existing file via the file adapter.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When an application always generates the policy at startup and the policy doesn't change after that at runtime, do we need a persistance layer?
I'd like to do something like:
casbin.NewEnforcer(authorizationModelConfig, "")
but that doesnt' work.
I've found the following in the code:
if err = e.adapter.LoadPolicy(newModel); err != nil && err.Error() != "invalid file path, file path cannot be empty" { return err }
Execution still fails with "invalid file path, file path cannot be empty".
A workaround is providing an empty, but existing file via the file adapter.
Am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions