Skip to content

Commit

Permalink
docs(readme.md): remove ResourcePermissions section as it is redundan…
Browse files Browse the repository at this point in the history
…t and not relevant to the current documentation focus
  • Loading branch information
multipliedtwice committed Jul 27, 2024
1 parent 9cee7e3 commit f129d08
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,35 +113,6 @@ app.post('/notes', async (req, res) => {
| `synonyms` | `Record<string, string[]>` | Maps model synonyms to their actual model names, useful for handling schema relation mismatches. |
| `mismatchHandler` | `(mismatch: string[]) => void`| Handles cases where users don't have permissions or permission models have changed, simplifying maintenance and fixing discrepancies. |

## ResourcePermissions

```typescript
type AccessControlActions = "create" | "update" | "delete" | "read";

/** Role-based permissions for resources */
export interface ResourcePermissions {
[resource: string]: {
[action in AccessControlActions]?: boolean;
};
}

// Example
const permissions: ResourcePermissions = {
user: {
create: true,
update: true,
delete: false,
read: true,
},
note: {
create: true,
update: false,
delete: false,
read: true,
},
};
```

### Performance
Prisma-RBAC is optimized for performance, ensuring minimal overhead on your application's data access operations. Internal functions have been benchmarked to execute quickly (~0.003 ms), even under heavy load.

Expand Down

0 comments on commit f129d08

Please sign in to comment.