Beispiel #1
0
 def _hasAccess(self, aw):
     if not Config.getInstance().getIsRoomBookingActive() or not rb_check_user_access(aw.getUser()):
         return False
     if self._room.can_be_booked(aw.getUser()):
         return True
     elif self._room.can_be_prebooked(aw.getUser()):
         raise HTTPAPIError('The API only supports direct bookings but this room only allows pre-bookings.')
     return False
Beispiel #2
0
 def _hasAccess(self, aw):
     if not Config.getInstance().getIsRoomBookingActive() or not rb_check_user_access(aw.getUser()):
         return False
     if self._room.can_be_booked(aw.getUser()):
         return True
     elif self._room.can_be_prebooked(aw.getUser()):
         raise HTTPAPIError('The API only supports direct bookings but this room only allows pre-bookings.')
     return False
Beispiel #3
0
 def _checkSessionUser(self):
     if not Config.getInstance().getIsRoomBookingActive():
         raise AccessError()
     if not session.user:
         self._redirect(self._getLoginURL())
         self._doProcess = False
         return
     if not rb_check_user_access(session.user):
         raise AccessError()
Beispiel #4
0
 def _checkSessionUser(self):
     if not Config.getInstance().getIsRoomBookingActive():
         raise AccessError()
     if not session.user:
         self._redirect(self._getLoginURL())
         self._doProcess = False
         return
     if not rb_check_user_access(session.user):
         raise AccessError()
Beispiel #5
0
    def _can_be_booked(self, avatar, prebook=False, ignore_admin=False):
        if not avatar or not rb_check_user_access(avatar):
            return False

        if (not ignore_admin and avatar.isRBAdmin()) or (self.is_owned_by(avatar) and self.is_active):
            return True

        if self.is_active and self.is_reservable and (prebook or not self.reservations_need_confirmation):
            group_name = self.get_attribute_value('allowed-booking-group')
            if not group_name or avatar.is_member_of_group(group_name):
                return True

        return False
Beispiel #6
0
 def _hasAccess(self, aw):
     return Config.getInstance().getIsRoomBookingActive() and rb_check_user_access(aw.getUser())
Beispiel #7
0
 def _hasAccess(self, aw):
     return Config.getInstance().getIsRoomBookingActive() and rb_check_user_access(aw.getUser())