booked/lib/Application/Reservation/ReservationAuthorization.php
/**
	 * @param ReservationView $reservationView
	 * @param UserSession $currentUser
	 * @return bool
	 */
@param ReservationView $reservationView
@param UserSession $currentUser
@return bool
@param ReservationView $reservationView @param UserSession $currentUser @return bool
private function IsAccessibleTo(ReservationView $reservationView, UserSession $currentUser)
	{
		if ($reservationView->OwnerId == $currentUser->UserId || $currentUser->IsAdmin)
		{
			return true;
		}
		else
		{
			$canReserveForUser = $this->authorizationService->CanReserveFor($currentUser, $reservationView->OwnerId);
			if ($canReserveForUser)
			{
				return true;
			}
			foreach ($reservationView->Resources as $resource)
			{
				if ($this->authorizationService->CanEditForResource($currentUser, $resource))
				{
					return true;
				}
			}
		}
		return false;
	}
private function IsAccessibleTo ( ReservationView $ reservationView , UserSession $ currentUser ) { if ( $ reservationView -> OwnerId == $ currentUser -> UserId || $ currentUser -> IsAdmin ) { return true ; } else { $ canReserveForUser = $ this -> authorizationService -> CanReserveFor ( $ currentUser , $ reservationView -> OwnerId ) ; if ( $ canReserveForUser ) { return true ; } foreach ( $ reservationView -> Resources as $ resource ) { if ( $ this -> authorizationService -> CanEditForResource ( $ currentUser , $ resource ) ) { return true ; } } } return false ; }
@param ReservationView $reservationView
 @param UserSession $currentUser
 @return bool
@param ReservationView $reservationView @param UserSession $currentUser @return bool