Skip to content

Commit

Permalink
Merge branch 'main' of github.com:verful/adonis-permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur-er committed Jul 27, 2022
2 parents f1307dd + 6f47b8b commit af74c15
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ node ace configure @verful/permissions
```

## **Getting started**
Once the package is installed the first thing you wan't to do is apply the `Authorizable` mixin from `@ioc:Verful/Permissions/Mixins` into a model
Once the package is installed the first thing you want to do is apply the `Authorizable` mixin from `@ioc:Verful/Permissions/Mixins` into a model

```typescript
import { Authorizable } from '@ioc:Verful/Permissions/Mixins'
Expand All @@ -50,6 +50,11 @@ const config = {
export default class User extends compose(BaseModel, Authorizable(config)) {}
```

Now its time to create the pivot-table migration files
```
node ace permissions:pivot-table
```

After the mixin is applied you can do stuff like this
```typescript
await user.givePermissionTo('view-users')
Expand Down

0 comments on commit af74c15

Please sign in to comment.