mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
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:
@@ -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__);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user