mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-21 15:54:22 +01:00
(bug) admin cannot book an event for himself
This commit is contained in:
parent
c1159b2aed
commit
0ac3caf96a
@ -1,6 +1,7 @@
|
|||||||
# Changelog Fab-manager
|
# Changelog Fab-manager
|
||||||
|
|
||||||
- Fix a bug: updating plan prices
|
- Fix a bug: updating plan prices
|
||||||
|
- Fix a bug: admin cannot book an event for himself
|
||||||
|
|
||||||
## v5.6.6 2023 January 23
|
## v5.6.6 2023 January 23
|
||||||
|
|
||||||
|
@ -329,16 +329,15 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', '
|
|||||||
|
|
||||||
return Wallet.getWalletByUser({ user_id: $scope.ctrl.member.id }, function (wallet) {
|
return Wallet.getWalletByUser({ user_id: $scope.ctrl.member.id }, function (wallet) {
|
||||||
const amountToPay = helpers.getAmountToPay($scope.reserve.amountTotal, wallet.amount);
|
const amountToPay = helpers.getAmountToPay($scope.reserve.amountTotal, wallet.amount);
|
||||||
if ((AuthService.isAuthorized(['member']) && amountToPay > 0)
|
if ((AuthService.isAuthorized('member') && amountToPay > 0)
|
||||||
|| (AuthService.isAuthorized('manager') && $scope.ctrl.member.id === $rootScope.currentUser.id && amountToPay > 0)) {
|
|| (AuthService.isAuthorized(['manager', 'admin']) && $scope.ctrl.member.id === $rootScope.currentUser.id && amountToPay > 0)) {
|
||||||
if (settingsPromise.online_payment_module !== 'true') {
|
if (settingsPromise.online_payment_module !== 'true') {
|
||||||
growl.error(_t('app.public.events_show.online_payment_disabled'));
|
growl.error(_t('app.public.events_show.online_payment_disabled'));
|
||||||
} else {
|
} else {
|
||||||
return payOnline(reservation);
|
return payOnline(reservation);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (AuthService.isAuthorized('admin')
|
if (AuthService.isAuthorized(['manager', 'admin']) && $scope.ctrl.member.id !== $rootScope.currentUser.id
|
||||||
|| (AuthService.isAuthorized('manager') && $scope.ctrl.member.id !== $rootScope.currentUser.id)
|
|
||||||
|| amountToPay === 0) {
|
|| amountToPay === 0) {
|
||||||
return payOnSite(reservation);
|
return payOnSite(reservation);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user