From ca5343cffa4b059c7a7d9b07afe72064658b9000 Mon Sep 17 00:00:00 2001 From: Zxilly Date: Sun, 25 Apr 2021 23:07:01 +0800 Subject: [PATCH] docs: fix setUser usage (#57) Signed-off-by: Zxilly --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d2474db8..633d7bdc 100644 --- a/README.md +++ b/README.md @@ -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();