Skip to content

Commit c9e5dd8

Browse files
Merge pull request #17 from aniplaylist/patch-1
Add relationships permissions in README
2 parents abfaec6 + 3931e9c commit c9e5dd8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ The example above means that all actions on this resource can be performed by us
134134
];
135135
```
136136

137+
### Relationships
138+
To allow your users to specify a relationship on your model, you will need to add another permission on the Model.
139+
For example, if your `Product` belongs to `User`, add the following permission on `app/Nova/User.php`. :
140+
141+
```php
142+
public static $permissionsForAbilities = [
143+
'addProduct' => 'add user on products'
144+
];
145+
```
146+
137147
## Contributing
138148

139149
Contributions are welcome and will be fully credited as long as you use PSR-2, explain the issue/feature that you want to solve/add and back your code up with tests. Happy coding!

0 commit comments

Comments
 (0)