File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 99 <PropertyGroup >
1010 <PackageId >Casbin.Watcher.Redis</PackageId >
1111 <PackageIcon >casbin.png</PackageIcon >
12+ <PackageReadmeFile >README.md</PackageReadmeFile >
1213 <Authors >Casbin.NET</Authors >
14+ <Description >Redis watcher for Casbin.NET</Description >
1315 <RepositoryType >GIT</RepositoryType >
1416 <RepositoryUrl >https://github.com/casbin-net/redis-watcher</RepositoryUrl >
1517 <Copyright >Apache License 2.0</Copyright >
3234 <ItemGroup >
3335 <None Include =" casbin.png" Pack =" true" Visible =" false" PackagePath =" " />
3436 </ItemGroup >
37+
38+ <ItemGroup >
39+ <None Include =" ../README.md" Pack =" true" PackagePath =" " />
40+ </ItemGroup >
41+
3542</Project >
Original file line number Diff line number Diff line change 11# redis-watcher
2+
3+ [ ![ Actions Status] ( https://github.com/casbin-net/redis-watcher/workflows/Build/badge.svg )] ( https://github.com/casbin-net/redis-watcher/actions )
4+ [ ![ Coverage Status] ( https://coveralls.io/repos/github/casbin-net/redis-watcher/badge.svg?branch=master )] ( https://coveralls.io/github/casbin-net/redis-watcher?branch=master )
5+ [ ![ License] ( https://img.shields.io/github/license/casbin-net/redis-watcher )] ( https://github.com/casbin-net/redis-watcher/blob/master/LICENSE )
6+ [ ![ Build Version] ( https://img.shields.io/casbin-net.myget/casbin-net/v/Casbin.Watcher.Redis?label=Casbin.Watcher.Redis )] ( https://www.myget.org/feed/casbin-net/package/nuget/Casbin.Watcher.Redis )
7+
28Redis watcher for Casbin.NET
9+
10+ ## Installation
11+
12+ ```
13+ dotnet add package Casbin.Watcher.Redis
14+ ```
15+
16+ ## Simple Example
17+
18+ ``` csharp
19+ using Casbin ;
20+ using Redis .Casbin .NET ;
21+
22+ public class Program
23+ {
24+ public static void Main (string [] args )
25+ {
26+ // Initialize the watcher.
27+ // Use the Redis host as parameter.
28+ var watcher = new RedisWatcher (" 127.0.0.1:6379" );
29+
30+ // Initialize the enforcer.
31+ var enforcer = new Enforcer (" examples/rbac_model.conf" , " examples/rbac_policy.csv" );
32+
33+ // Set the watcher for the enforcer.
34+ enforcer .SetWatcher (watcher );
35+
36+ // Update the policy to test the effect.
37+ enforcer .SavePolicy ();
38+ }
39+ }
40+ ```
41+
42+ ## Getting Help
43+
44+ - [ Casbin.NET] ( https://github.com/casbin/Casbin.NET )
45+
46+ ## License
47+
48+ This project is under Apache 2.0 License. See the [ LICENSE] ( LICENSE ) file for the full license text.
You can’t perform that action at this time.
0 commit comments