Hi, if role "Admin", when I hit the "Staff Management" button, I get the message:
"Attempt to read property "staff" on null" -> StaffMemberController
J
Joe
✓ Link copied!
The admin user doesn't have a restaurant so using this code it's impossible to add a staff member because there is no available restaurant to associate it with.
For it to be possible to add a staff member from the admin user, we'd need to have a dropdown on the AddStaffMemberForm.vue to choose a restaurant.
DL
David Lun
✓ Link copied!
yeah, admin is not supposed to visit staff management page, we should add check if the user is really admin to fix that, thanks for noticing.
UPDATE: Course is updated, also commenting here if anyone has this issue
Since admin also has user.create permission we add additional check if authenticated user has vendor role. Admin should not be able to manage staff members.
Hi, if role "Admin", when I hit the "Staff Management" button, I get the message: "Attempt to read property "staff" on null" -> StaffMemberController
The admin user doesn't have a restaurant so using this code it's impossible to add a staff member because there is no available restaurant to associate it with.
For it to be possible to add a staff member from the admin user, we'd need to have a dropdown on the
AddStaffMemberForm.vueto choose a restaurant.yeah, admin is not supposed to visit staff management page, we should add check if the user is really admin to fix that, thanks for noticing.
UPDATE: Course is updated, also commenting here if anyone has this issue
Since admin also has
user.createpermission we add additional check if authenticated user has vendor role. Admin should not be able to manage staff members.resources/js/Layouts/AuthenticatedLayout.vue
And add
is_vendorproperty to the shared data.app/Http/Middleware/HandleInertiaRequests.php