mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-18 04:50:30 +00:00
✨ Add leader-based permissions to Meetup event tests and editable scope
- 🔒 Ensure leader users are required for Meetup event tests to simulate accurate permissions. - ➕ Add `editableBy` scope to `MeetupEvent` model for consistent editable event handling. - 🛠️ Refactor `mine` API endpoint and MCP tool to leverage `editableBy` scope. - 🧪 Update tests to verify leader-based accessibility for Meetup events.
This commit is contained in:
@@ -12,7 +12,7 @@ use Laravel\Mcp\Server\Tool;
|
||||
use Laravel\Mcp\Server\Tools\Annotations\IsReadOnly;
|
||||
|
||||
#[IsReadOnly]
|
||||
#[Description('Listet alle vom authentifizierten Nutzer erstellten Meetup-Termine, nach Startzeitpunkt absteigend sortiert.')]
|
||||
#[Description('Listet alle Meetup-Termine, die der authentifizierte Nutzer bearbeiten darf (selbst angelegt oder Leader des Meetups), nach Startzeitpunkt absteigend sortiert.')]
|
||||
class ListMyMeetupEventsTool extends Tool
|
||||
{
|
||||
public function handle(Request $request): Response
|
||||
@@ -24,7 +24,7 @@ class ListMyMeetupEventsTool extends Tool
|
||||
}
|
||||
|
||||
$meetupEvents = MeetupEvent::query()
|
||||
->where('created_by', $user->getAuthIdentifier())
|
||||
->editableBy((int) $user->getAuthIdentifier())
|
||||
->orderByDesc('start')
|
||||
->get();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user