#157 - added a privilege check
This commit is contained in:
parent
c154c51ef4
commit
48ef40e8ff
@ -44,6 +44,7 @@ class VacationCalendarController extends Controller
|
||||
"users" => SimpleUserResource::collection($users),
|
||||
"can" => [
|
||||
"generateTimesheet" => $request->user()->can("generateTimesheet"),
|
||||
"createOnBehalfOfEmployee" => $request->user()->can("createOnBehalfOfEmployee"),
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
@ -101,7 +101,7 @@
|
||||
:key="day.dayOfMonth"
|
||||
class="border border-gray-300"
|
||||
:class="{ 'bg-blumilk-25': day.isToday, 'bg-red-100': day.isWeekend || day.isHoliday }"
|
||||
@mouseover="setActiveBtn(user.id.toString() + '' + day.date)"
|
||||
@mouseover="setActiveBtn(user.id + '+' + day.date)"
|
||||
@mouseleave="unsetActiveBtn"
|
||||
>
|
||||
<div
|
||||
@ -111,7 +111,7 @@
|
||||
<VacationTypeCalendarIcon :type="day.vacationTypes[user.id]" />
|
||||
</div>
|
||||
<InertiaLink
|
||||
v-else-if="isActiveBtn(user.id.toString() + '' + day.date) && !day.isWeekend && !day.isHoliday && day.isFuture"
|
||||
v-else-if="isActiveBtn(user.id + '+' + day.date) && !day.isWeekend && !day.isHoliday && day.isFuture && (auth.user.id === user.id || can.createOnBehalfOfEmployee)"
|
||||
href="/vacation/requests/create"
|
||||
:data="{ 'start_date': day.date }"
|
||||
>
|
||||
@ -146,6 +146,8 @@ const props = defineProps({
|
||||
can: Object,
|
||||
})
|
||||
|
||||
console.log(props.auth.user)
|
||||
|
||||
let activeElement = ref(undefined)
|
||||
|
||||
const { getMonths, findMonth } = useMonthInfo()
|
||||
|
Loading…
x
Reference in New Issue
Block a user