Skip to content

Commit 260a995

Browse files
authored
techdocs added (#112)
1 parent 44173da commit 260a995

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

catalog-info.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ metadata:
44
name: loopback4-authorization
55
annotations:
66
github.com/project-slug: sourcefuse/loopback4-authorization
7+
backstage.io/techdocs-ref: dir:.
78
namespace: arc
89
description: A LoopBack 4 extension for managing API Authorization.
910
tags:

README.md renamed to docs/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Where permissions are associated to roles and users have a specific role attache
5050

5151
#### 3. Role Based Permissions with User Level Flexibility
5252

53-
This is the most flexible architecture. In this case, method #2 is implemented as is.
53+
This is the most flexible architecture. In this case, method #2 is implemented as is.
5454

5555
On top of it, we also add user-level permissions override, allow/deny permissions over role permissions. So, say there is user who can perform all admin role actions except he cannot remove users from the system. So, DeleteUser permission can be denied at user level and role can be set as Admin for the user.
5656

@@ -150,7 +150,7 @@ export class User extends Entity implements UserPermissionsOverride<string> {
150150

151151
#### User Permissions Provider
152152

153-
For method #3, This extension exposes a provider function [AuthorizationBindings.USER_PERMISSIONS](https://github.com/sourcefuse/loopback4-authorization/blob/master/src/providers/user-permissions.provider.ts) to evaluate the user permissions based on its role permissions and user-level overrides.
153+
For method #3, This extension exposes a provider function [AuthorizationBindings.USER_PERMISSIONS](https://github.com/sourcefuse/loopback4-authorization/blob/master/src/providers/user-permissions.provider.ts) to evaluate the user permissions based on its role permissions and user-level overrides.
154154

155155
Just inject it like below:
156156

@@ -307,7 +307,7 @@ API endpoints provided by ARC API (aka Sourceloop) services have their permissio
307307
In order to override them you can bind your custom permissions in the `AuthorizationBindings.PERMISSION` binding key.
308308
This accepts an object that should have Controller class name as the root level key and the value of which is another object of method to permissions array mapping.
309309

310-
Like below:
310+
Like below:
311311

312312
```ts
313313
this.bind(AuthorizationBindings.PERMISSION).to({
@@ -322,7 +322,7 @@ this.bind(AuthorizationBindings.PERMISSION).to({
322322
});
323323
```
324324

325-
You can easily check the name of the controller and it's method name from the source code of the services or from the Swagger UI (clicking the endpoint in swagger append the controller and method name in the URL like `LoginController.login` where `login` is the method name).
325+
You can easily check the name of the controller and it's method name from the source code of the services or from the Swagger UI (clicking the endpoint in swagger append the controller and method name in the URL like `LoginController.login` where `login` is the method name).
326326

327327
## Serving the static files:
328328

mkdocs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
site_name: loopback4-authorization
2+
site_description: loopback4-authorization
3+
4+
plugins:
5+
- techdocs-core

0 commit comments

Comments
 (0)