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'.
This commit is contained in:
HolgerHatGarKeineNode
2024-01-15 20:33:46 +01:00
parent 79b4e252fe
commit d89d54710a
2 changed files with 2 additions and 2 deletions

View File

@@ -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__);
}
/**

View File

@@ -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