Skip to content

Commit fce5937

Browse files
committed
Docs: Add context to BCell documentation examples (#63)
1 parent a002c7a commit fce5937

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

docs/systems/immune/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ const isValid = await auth.verifyMFA('user-123', '123456');
331331

332332
### Creating Permissions
333333

334+
Permissions are the most granular level of access control. They define specific actions that can be performed on specific resources. By creating granular permissions, you can precisely control what users are allowed to do within your application.
335+
334336
```typescript
335337
// Create granular permissions
336338
authz.createPermission({
@@ -357,6 +359,8 @@ authz.createPermission({
357359

358360
### Creating Roles
359361

362+
Roles are collections of permissions. Instead of assigning individual permissions to each user, you assign roles, which simplifies management and makes your authorization model more scalable. Roles can also inherit permissions from other roles.
363+
360364
```typescript
361365
// Basic role
362366
authz.createRole({
@@ -378,6 +382,8 @@ authz.createRole({
378382

379383
### Assigning Roles
380384

385+
Once roles and permissions are defined, you can assign roles to users. A user can have one or more roles, granting them all the permissions associated with those roles.
386+
381387
```typescript
382388
// Assign role to user
383389
authz.assignRole('user-123', 'author');
@@ -392,6 +398,8 @@ authz.revokeRole('user-123', 'author');
392398

393399
### Checking Authorization
394400

401+
After setting up permissions and roles, you can check if a user is authorized to perform a specific action on a given resource. This is the core of enforcing access control within your application.
402+
395403
```typescript
396404
// Check if user can perform action
397405
const result = await authz.authorize({

0 commit comments

Comments
 (0)