You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been struggling with belongsTo relationships not being available for my roles.
I tried debugging the package and noticed that a `add + Model name` permission was generated for that kind of relationships.
Feel free to rephrase what I wrote if it's not clear!
Copy file name to clipboardExpand all lines: README.md
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -134,6 +134,16 @@ The example above means that all actions on this resource can be performed by us
134
134
];
135
135
```
136
136
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
+
137
147
## Contributing
138
148
139
149
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