From d89d54710aac8a1a5ef58f792a17229be294c6a3 Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Mon, 15 Jan 2024 20:33:46 +0100 Subject: [PATCH] feat: Update CourseEventPolicy and Docker compose settings Update the 'update' method in CourseEventPolicy to check if the event was created by the user. Adjust the service name in docker-compose from 'laravel.test' to 'laravel'. --- app/Policies/CourseEventPolicy.php | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Policies/CourseEventPolicy.php b/app/Policies/CourseEventPolicy.php index 222b72f9..7d9f4eec 100644 --- a/app/Policies/CourseEventPolicy.php +++ b/app/Policies/CourseEventPolicy.php @@ -47,7 +47,7 @@ class CourseEventPolicy extends BasePolicy */ public function update(User $user, CourseEvent $courseEvent): bool { - return $user->belongsToTeam($courseEvent->course->lecturer->team) || $user->can((new \ReflectionClass($this))->getShortName().'.'.__FUNCTION__); + return $courseEvent->created_by === $user->id || $user->can((new \ReflectionClass($this))->getShortName() . '.' . __FUNCTION__); } /** diff --git a/docker-compose.yml b/docker-compose.yml index f510c2bf..a7591336 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ # For more information: https://laravel.com/docs/sail version: '3' services: - laravel.test: + laravel: build: context: ./docker/8.2 dockerfile: Dockerfile