mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
(bug) admin can't move/cancel event reservation
This commit is contained in:
parent
507420f96c
commit
e3b62df7d4
@ -1,6 +1,7 @@
|
||||
# Changelog Fab-manager
|
||||
|
||||
- Script to download translations from Crowdin
|
||||
- Fix a bug: admin and managers can't cancel or move event reservations
|
||||
|
||||
## v5.4.17 2022 September 06
|
||||
|
||||
|
@ -483,6 +483,8 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', '
|
||||
* @param reservation {Reservation}
|
||||
*/
|
||||
$scope.reservationCanModify = function (reservation) {
|
||||
if (AuthService.isAuthorized(['admin', 'manager'])) return true;
|
||||
|
||||
const slotStart = moment(reservation.slots_reservations_attributes[0].slot_attributes.start_at);
|
||||
const now = moment();
|
||||
|
||||
@ -498,6 +500,8 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', '
|
||||
* @param reservation {Reservation}
|
||||
*/
|
||||
$scope.reservationCanCancel = function(reservation) {
|
||||
if (AuthService.isAuthorized(['admin', 'manager'])) return true;
|
||||
|
||||
const slotStart = moment(reservation.slots_reservations_attributes[0].slot_attributes.start_at);
|
||||
const now = moment();
|
||||
return $scope.enableBookingCancel && slotStart.diff(now, "hours") >= $scope.cancelBookingDelay;
|
||||
|
Loading…
x
Reference in New Issue
Block a user