You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-2Lines changed: 42 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,9 +172,49 @@ You can define multiple permissions, but only when all of them satisfied, could
172
172
173
173
Only when the user is granted both permissions of reading any user address and reading any roles, could he/she access the route.
174
174
175
-
#### Using `AuthzRBACService` or `AuthzManagementService`
175
+
#### Using `AuthZService`
176
176
177
-
While the `@UsePermissions` decorator is good enough for most cases, there are situations where we may want to check for a permission in a method's body. We can inject and use `AuthzRBACService` or `AuthzManagementService` which are wrappers of casbin api for that as shown in the example below:
177
+
While the `@UsePermissions` decorator is good enough for most cases, there are situations where we may want to check for a permission in a method's body. We can inject and use `AuthZService` which is a wrapper of the Casbin RBAC + Management API for that as shown in the example below:
// A user can not reach this point if he/she is not granted for permission read users
207
+
// ...
208
+
}
209
+
}
210
+
```
211
+
212
+
213
+
#### (Deprecated) Using `AuthZRBACService` or `AuthZManagementService`
214
+
215
+
> The functionality provided by `AuthZRBACService` and `AuthZManagementService` has been unified in `AuthZService`, so these services will be removed in a later release.
216
+
217
+
We can inject and use `AuthZRBACService` or `AuthZManagementService` which are wrappers of the Casbin RBAC and Management APIs, respectively, as shown in the example below:
0 commit comments