/home/techb158/ileadtechnology.com/SSM/app/Policies/calendar
NameSizeModeActions
EventPolicy.php22350644editdlrm
HolidayPolicy.php16540644editdlrm
Edit: /home/techb158/ileadtechnology.com/SSM/app/Policies/calendar/EventPolicy.php (2235B)
can('create-event') || $user->can('edit-event'); } /** * Determine whether the user can list all the event. * * @param \App\User $user * @param \App\Models\Calendar\Event $event * @return mixed */ public function list(User $user) { return $user->can('list-event'); } /** * Determine whether the user can create event. * * @param \App\User $user * @return mixed */ public function create(User $user) { return $user->can('create-event'); } /** * Determine whether the user can view the event. * * @param \App\User $user * @param \App\Models\Calendar\Event $event * @return mixed */ public function show(User $user) { if (! $user->can('list-event')) return false; if ($user->hasAnyRole([ config('system.default_role.student'), config('system.default_role.parent') ]) && ! in_array($event->audience, ['everyone','selected_course','selected_batch'])); return false; return true; } /** * Determine whether the user can update the event. * * @param \App\User $user * @param \App\Models\Calendar\Event $event * @return mixed */ public function update(User $user) { return $user->can('edit-event'); } /** * Determine whether the user can delete the event. * * @param \App\User $user * @param \App\Models\Calendar\Event $event * @return mixed */ public function delete(User $user) { return $user->can('delete-event'); } }