feat(acl): Change views/backend code to able to use proper ACL's later on. Currently it is not enabled.
This commit is contained in:
@@ -4,10 +4,13 @@ namespace App\Livewire\Team;
|
||||
|
||||
use App\Models\TeamInvitation;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Livewire\Component;
|
||||
|
||||
class Invitations extends Component
|
||||
{
|
||||
use AuthorizesRequests;
|
||||
|
||||
public $invitations;
|
||||
|
||||
protected $listeners = ['refreshInvitations'];
|
||||
@@ -15,6 +18,8 @@ class Invitations extends Component
|
||||
public function deleteInvitation(int $invitation_id)
|
||||
{
|
||||
try {
|
||||
$this->authorize('manageInvitations', currentTeam());
|
||||
|
||||
$invitation = TeamInvitation::ownedByCurrentTeam()->findOrFail($invitation_id);
|
||||
$user = User::whereEmail($invitation->email)->first();
|
||||
if (filled($user)) {
|
||||
|
||||
Reference in New Issue
Block a user