private List<AvailabilityPoint> getAvailabilitiesForContext(Subject subject, EntityContext context,
long fullRangeBeginTime, long fullRangeEndTime, int numberOfPoints, boolean withCurrentAvailability) {
if (context.type == EntityContext.Type.Resource) {
if (!authorizationManager.canViewResource(subject, context.resourceId)) {
throw new PermissionException("User [" + subject.getName() + "] does not have permission to view "
+ context.toShortString());
}
} else if (context.type == EntityContext.Type.ResourceGroup) {
if (!authorizationManager.canViewGroup(subject, context.groupId)) {
throw new PermissionException("User [" + subject.getName() + "] does not have permission to view "
+ context.toShortString());
}
} else {
}