}
@PreAuthorize("((#groupId != null ? isUserInDomain(#groupId) : true) and (#categoryId != null ? hasAccessToCategory(#categoryId, #userAgentInfo.applicationType) : true)) or hasRole('ROLE_ADMIN')")
@RequestMapping(value = "/home", method = RequestMethod.GET)
public String home(UserAgentInfo userAgentInfo, Model model, @RequestParam(value = "grp", required = false) Long groupId, @RequestParam(value = "ctg", required = false) Long categoryId, @RequestParam(value = "type", required = false) ApplicationType applicationType) {
User user = userService.getUserFromSecurityContext();
List<ApplicationModel> applicationModels;
if ((groupId != null && groupId > 0) || (categoryId != null && categoryId > 0) || applicationType != null) {
applicationModels = userService.getApplicationsForUserFiltered(user, userAgentInfo.getApplicationType(), groupId, categoryId, applicationType);
} else {
applicationModels = userService.getApplicationModelsForUser(user, userAgentInfo.getApplicationType());
}
model.addAttribute("applications", applicationModels);
if (user.getActiveOrganization() == null) {
model.addAttribute("doesUserRelationshipExist", false);
} else {
model.addAttribute("doesUserRelationshipExist", true);
}