|
1 | 1 | # dart-casbin |
2 | 2 |
|
3 | | -An authorization library that supports access control models like ACL, RBAC, ABAC in Dart. |
4 | | - |
| 3 | +[](https://pub.dev/packages/casbin) |
| 4 | +[](https://github.com/casbin/dart-casbin/actions) |
5 | 5 | [](https://discord.gg/S5UjpzGZjN) |
| 6 | +[](LICENSE) |
| 7 | + |
| 8 | +An authorization library that supports access control models like ACL, RBAC, ABAC in Dart. |
6 | 9 |
|
7 | 10 | **News**: Are you still worried about how to write the correct Casbin policy? `Casbin online editor` is coming to help! Try it at: http://casbin.org/editor/ |
8 | 11 |
|
9 | 12 |  |
10 | 13 |
|
| 14 | +## Table of Contents |
| 15 | + |
| 16 | +- [Installation](#installation) |
| 17 | +- [Get Started](#get-started) |
| 18 | +- [Supported Models](#supported-models) |
| 19 | +- [How It Works](#how-it-works) |
| 20 | +- [Features](#features) |
| 21 | +- [Documentation](#documentation) |
| 22 | +- [Examples](#examples) |
| 23 | +- [License](#license) |
| 24 | + |
11 | 25 | ## All the languages supported by Casbin: |
12 | 26 |
|
13 | 27 | | [](https://github.com/casbin/casbin) | [](https://github.com/casbin/jcasbin) | [](https://github.com/casbin/node-casbin) | [](https://github.com/php-casbin/php-casbin) | |
@@ -98,11 +112,34 @@ You can also use the online editor (https://casbin.org/editor/) to write your Ca |
98 | 112 |
|
99 | 113 | https://casbin.org/docs/tutorials |
100 | 114 |
|
| 115 | +## Installation |
| 116 | + |
| 117 | +Add this to your package's `pubspec.yaml` file: |
| 118 | + |
| 119 | +```yaml |
| 120 | +dependencies: |
| 121 | + casbin: ^1.0.0 |
| 122 | +``` |
| 123 | +
|
| 124 | +Then run: |
| 125 | +
|
| 126 | +```bash |
| 127 | +dart pub get |
| 128 | +``` |
| 129 | + |
| 130 | +Or with Flutter: |
| 131 | + |
| 132 | +```bash |
| 133 | +flutter pub get |
| 134 | +``` |
| 135 | + |
101 | 136 | ## Get started |
102 | 137 |
|
103 | 138 | 1. New a Casbin enforcer with a model file and a policy file: |
104 | 139 |
|
105 | 140 | ```dart |
| 141 | + import 'package:casbin/casbin.dart'; |
| 142 | +
|
106 | 143 | var e = Enforcer.fromModelPathAndPolicyFile('path/to/model.conf', 'path/to/policy.csv'); |
107 | 144 | ``` |
108 | 145 |
|
|
0 commit comments