Skip to content
Permalink
Browse files Browse the repository at this point in the history
password change requires 6 on update, and only allowed users can see …
…calendar
  • Loading branch information
Bottelet committed Jun 25, 2021
1 parent 1db9beb commit a0392f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions app/Http/Controllers/AppointmentsController.php
Expand Up @@ -15,6 +15,10 @@ class AppointmentsController extends Controller
{
public function calendar()
{
if (!auth()->user()->can("calendar-view")) {
session()->flash('flash_message_warning', __('You do not have permission to view this page'));
return redirect()->back();
}
return view('appointments.calendar');
}

Expand All @@ -38,7 +42,6 @@ public function update(UpdateAppointmentCalendarRequest $request, Appointment $a

public function store(CreateAppointmentCalendarRequest $request)
{

$client_id = null;
$user = User::where('external_id', $request->user)->first();

Expand Down Expand Up @@ -86,7 +89,7 @@ public function store(CreateAppointmentCalendarRequest $request)

public function destroy(Appointment $appointment)
{
if (!auth()->user()->can("appointment-create")) {
if (!auth()->user()->can("appointment-delete")) {
return response("Access denied", 403);
}

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Requests/User/StoreUserRequest.php
Expand Up @@ -29,8 +29,8 @@ public function rules()
'address' => '',
'primary_number' => 'numeric',
'secondary_number' => 'numeric',
'password' => 'required|min:5|confirmed',
'password_confirmation' => 'required|min:5',
'password' => 'required|min:6|confirmed',
'password_confirmation' => 'required|min:6',
'image_path' => '',
'roles' => 'required',
'departments' => 'required'
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Requests/User/UpdateUserRequest.php
Expand Up @@ -29,8 +29,8 @@ public function rules()
'address' => '',
'primary_number' => 'numeric',
'secondary_number' => 'numeric',
'password' => 'sometimes',
'password_confirmation' => 'sometimes',
'password' => 'sometimes|min:6|confirmed',
'password_confirmation' => 'sometimes|min:6',
'image_path' => '',
'departments' => 'required'
];
Expand Down

0 comments on commit a0392f4

Please sign in to comment.