mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-17 12:42:15 +01:00
Renamed jetstream team to organization
This commit is contained in:
@@ -4,11 +4,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Team;
|
||||
use App\Models\Organization;
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class TeamPolicy
|
||||
class OrganizationPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
@@ -23,9 +23,9 @@ class TeamPolicy
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*/
|
||||
public function view(User $user, Team $team): bool
|
||||
public function view(User $user, Organization $organization): bool
|
||||
{
|
||||
return $user->belongsToTeam($team);
|
||||
return $user->belongsToTeam($organization);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,40 +39,40 @@ class TeamPolicy
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*/
|
||||
public function update(User $user, Team $team): bool
|
||||
public function update(User $user, Organization $organization): bool
|
||||
{
|
||||
return $user->ownsTeam($team);
|
||||
return $user->ownsTeam($organization);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can add team members.
|
||||
*/
|
||||
public function addTeamMember(User $user, Team $team): bool
|
||||
public function addTeamMember(User $user, Organization $organization): bool
|
||||
{
|
||||
return $user->ownsTeam($team);
|
||||
return $user->ownsTeam($organization);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update team member permissions.
|
||||
*/
|
||||
public function updateTeamMember(User $user, Team $team): bool
|
||||
public function updateTeamMember(User $user, Organization $organization): bool
|
||||
{
|
||||
return $user->ownsTeam($team);
|
||||
return $user->ownsTeam($organization);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can remove team members.
|
||||
*/
|
||||
public function removeTeamMember(User $user, Team $team): bool
|
||||
public function removeTeamMember(User $user, Organization $organization): bool
|
||||
{
|
||||
return $user->ownsTeam($team);
|
||||
return $user->ownsTeam($organization);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*/
|
||||
public function delete(User $user, Team $team): bool
|
||||
public function delete(User $user, Organization $organization): bool
|
||||
{
|
||||
return $user->ownsTeam($team);
|
||||
return $user->ownsTeam($organization);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user