Redis watcher for Casbin.NET

Clone this repo:
  1. 7818a16 fix: protect callbacks against failures (#11) by Mitch Freed · 2 years, 2 months ago master v1.2.1
  2. e604b74 feat: upgrade to casbin v2 (#10) by Mitch Freed · 2 years, 2 months ago v1.2.0
  3. 457cdc6 fix: Change README badge from Myget to Nuget (#8) by Tan · 2 years, 6 months ago v1.1.1
  4. 9117f7f feat: add README (#7) by Tan · 2 years, 6 months ago v1.1.0
  5. e5f6c70 fix: fix Nuget API token by hsluoyz · 2 years, 6 months ago v1.0.2

redis-watcher

Actions Status Coverage Status License Nuget

Redis watcher for Casbin.NET

Installation

dotnet add package Casbin.Watcher.Redis

Simple Example

using Casbin;
using Redis.Casbin.NET;

public class Program
{
    public static void Main(string[] args)
    {
        // Initialize the watcher.
        // Use the Redis host as parameter.
        var watcher = new RedisWatcher("127.0.0.1:6379");

        // Initialize the enforcer.
        var enforcer = new Enforcer("examples/rbac_model.conf", "examples/rbac_policy.csv");

        // Set the watcher for the enforcer.
        enforcer.SetWatcher(watcher);

        // Update the policy to test the effect.
        enforcer.SavePolicy();
    }
}

Getting Help

License

This project is under Apache 2.0 License. See the LICENSE file for the full license text.