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:
@@ -3,15 +3,19 @@
|
||||
namespace App\Livewire\Team\Member;
|
||||
|
||||
use App\Models\TeamInvitation;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Livewire\Component;
|
||||
|
||||
class Index extends Component
|
||||
{
|
||||
use AuthorizesRequests;
|
||||
|
||||
public $invitations = [];
|
||||
|
||||
public function mount()
|
||||
{
|
||||
if (auth()->user()->isAdminFromSession()) {
|
||||
// Only load invitations for users who can manage them
|
||||
if (auth()->user()->can('manageInvitations', currentTeam())) {
|
||||
$this->invitations = TeamInvitation::whereTeamId(currentTeam()->id)->get();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user