Skip to content

Commit

Permalink
docs: fix setUser usage (#57)
Browse files Browse the repository at this point in the history
Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>
  • Loading branch information
Zxilly authored Apr 25, 2021
1 parent 0d55ede commit ca5343c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const casbinjs = require('casbin.js');
const authorizer = new casbinjs.Authorizer('auto', {endpoint: 'http://Domain_name/casbin/api'});

// When the identity shifts, reset the user. Casbin.js will automatically fetch the permission from the endpoint.
authorizer.setUser("Tom");
await authorizer.setUser("Tom");

// Evaluate the permission
authorizer.can("read", "data1").then();
Expand Down

0 comments on commit ca5343c

Please # to comment.