From f10dea1479e992162cbb8da5cce2740d3a7400b7 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Thu, 28 Mar 2024 01:07:10 +0800 Subject: [PATCH] docs: add new constructor for Redis username in README --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 08d93d2..cb0af17 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,13 @@ public class Main { public static void main(String[] args) { // Initialize a Redis adapter and use it in a jCasbin enforcer: RedisAdapter a = new RedisAdapter("localhost", 6379); + // Use the following if Redis has password like "123" // RedisAdapter a = new RedisAdapter("localhost", 6379, "123"); + + // Use the following if Redis has username like "default" password like "123" + // RedisAdapter a = new RedisAdapter("localhost", 6379, "default", "123"); + Enforcer e = new Enforcer("examples/rbac_model.conf", a); // Load the policy from DB.