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
try {
// Because the DB is empty at first,
// so we need to load the policy from the file adapter (.CSV) first.
let e = await newEnforcer(
'examples/rbac_model.conf',
'examples/rbac_policy.csv'
);
// This is a trick to save the current policy to the DB.
// We can't call e.savePolicy() because the adapter in the enforcer is still the file adapter.
// The current policy means the policy in the Node-Casbin enforcer (aka in memory).
await a.savePolicy(e.getModel());
The text was updated successfully, but these errors were encountered:
Order of policies in DB after savePolicy is not same as in source file: examples/rbac_policy.csv
Sample test: https://github.com/node-casbin/prisma-adapter/blob/master/test/adapter.test.ts
Code snippet: line 40-50
The text was updated successfully, but these errors were encountered: