Skip to content

Commit

Permalink
docs: add new constructor for Redis username in README
Browse files Browse the repository at this point in the history
  • Loading branch information
hsluoyz committed Mar 27, 2024
1 parent 0f92b7b commit 5d7d85c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" and 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.
Expand Down

0 comments on commit 5d7d85c

Please sign in to comment.