Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions 1.x/features/teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,26 @@ public function view(User $user, Flight $flight)
$user->tokenCan('flight:view');
}
```

#### Team Policy Customisation

If you may want to customise the default Team policy in Jetstream, you can change that in `app/Policies/TeamPolicy.php`. For instance, you have a Laravel Nova installed together with Jetstream. You want to administrate the Teams in your application and you need to changes some of the policy for team to ensure you are able to update the teams in your application:

```php
/**
* Determine whether the user can update the model.
*
* @return mixed
*/
public function update(User $user, Team $team)
{
return $user->ownsTeam($team) || (
(
request()->is(config('nova.path') . '/*')
|| request()->is('nova-api/*')
|| request()->is('nova-vendor/*')
)
&& $user->hasRole('superadmin|administrator')
);
}
```