feat(events): authorize event editing and date changes by assigned event
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Domains\Ticketing\Event\Controllers\AdminApp;
|
||||
|
||||
use App\Domains\Core\Auth\Services\EventScopeService;
|
||||
use App\Domains\Ticketing\Event\Models\EventDate;
|
||||
use App\Domains\Ticketing\Event\Requests\RescheduleEventDateRequest;
|
||||
use App\Domains\Ticketing\Event\Requests\StoreEventDateRequest;
|
||||
@@ -19,7 +20,8 @@ class EventController extends Controller
|
||||
public function show(Request $request): EventResource
|
||||
{
|
||||
return EventResource::make(
|
||||
$this->eventService->forTenant($request->user()->tenant()->firstOrFail())
|
||||
$this->eventService->forTenant($request->user()->tenant()->firstOrFail(),
|
||||
app(EventScopeService::class)->eventId($request->user()))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,7 +30,8 @@ class EventController extends Controller
|
||||
return EventResource::make(
|
||||
$this->eventService->updateForTenant(
|
||||
$request->user()->tenant()->firstOrFail(),
|
||||
$request->validated()
|
||||
$request->validated(),
|
||||
app(EventScopeService::class)->eventId($request->user())
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -39,6 +42,7 @@ class EventController extends Controller
|
||||
$this->eventService->createDateForTenant(
|
||||
$request->user()->tenant()->firstOrFail(),
|
||||
$request->validated(),
|
||||
app(EventScopeService::class)->eventId($request->user()),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user