Package com.sparc.knappsack.components.entities

Examples of com.sparc.knappsack.components.entities.User


    }

    @PreAuthorize("isUserInOrganization(#id) or hasRole('ROLE_ADMIN')")
    @RequestMapping(value = "/activeOrganization/{id}")
    public String setActiveOrganization(@PathVariable Long id) {
        User user = userService.getUserFromSecurityContext();
        user.setActiveOrganization(organizationService.get(id));
        userService.update(user);

        return "redirect:/home";
    }
View Full Code Here


    @PreAuthorize("isOrganizationAdminForActiveOrganization() or hasRole('ROLE_ADMIN')")
    @RequestMapping(value = "/manager/getUsersForActiveOrganization", method = RequestMethod.GET)
    public @ResponseBody List<UserDomainModel> getUsersForActiveOrganization(@RequestParam(required = true) boolean includeGuests) {
        List<UserDomainModel> userDomainModels = new ArrayList<UserDomainModel>();
        User user = userService.getUserFromSecurityContext();

        if (user != null && user.getActiveOrganization() != null) {
            userDomainModels.addAll(organizationService.getAllOrganizationMembers(user.getActiveOrganization().getId(), includeGuests));
        }

        return userDomainModels;
    }
View Full Code Here

    @PreAuthorize("isOrganizationAdminForActiveOrganization() or hasRole('ROLE_ADMIN')")
    @RequestMapping(value = "/manager/getGuestsForActiveOrganization", method = RequestMethod.GET)
    public @ResponseBody List<UserDomainModel> getGuestsForActiveOrganization() {
        List<UserDomainModel> userDomainModels = new ArrayList<UserDomainModel>();
        User user = userService.getUserFromSecurityContext();

        if (user != null && user.getActiveOrganization() != null) {
            userDomainModels.addAll(organizationService.getAllOrganizationGuests(user.getActiveOrganization()));
        }

        return userDomainModels;
    }
View Full Code Here

    @ApiError(code = 500, reason = "Process error")
    @RequestMapping(method = RequestMethod.GET, produces = contentType)
    public
    @ResponseBody
    Application[] getApplications(UserAgentInfo userAgentInfo) {
        User user = userService.getUserFromSecurityContext();
        List<Application> applications = userService.getApplicationModelsForUser(user, userAgentInfo.getApplicationType(), Application.class);

        return applications.toArray(new Application[applications.size()]);
    }
View Full Code Here

            throw new RuntimeException("EntityService not found while checking if entity exists");
        }
    }

    private String generateLogErrorMessage(String errorId) {
        User user = userService.getUserFromSecurityContext();
        return LoggingUtil.generateLogErrorMessage(user, errorId);
    }
View Full Code Here

        Category category = categoryService.get(id);

        model.addAttribute("selectedCategory", categoryService.createCategoryModel(category, true));

        User user = userService.getUserFromSecurityContext();
        List<ApplicationModel> applicationModels = userService.getApplicationModelsForUser(user, userAgentInfo.getApplicationType(), category.getId());
        model.addAttribute("applications", applicationModels);

        return "category_resultsTH";
    }
View Full Code Here

        return "category_resultsTH";
    }

    @RequestMapping(value = "/categories", method = RequestMethod.GET)
    public String categories(Model model, UserAgentInfo userAgentInfo) {
        User user = userService.getUserFromSecurityContext();

        List<Category> categoryList = userService.getCategoriesForUser(user, userAgentInfo.getApplicationType(), SortOrder.ASCENDING);
        List<CategoryModel> categoryModelList = new ArrayList<CategoryModel>();

        for (Category category : categoryList) {
View Full Code Here

    public String addGroup(Model model) {

        if (!model.containsAttribute("group")) {
            model.addAttribute("group", new GroupForm());
        }
        User user = userService.getUserFromSecurityContext();
        model.addAttribute("organizations", user.getActiveOrganization());

        return "manager/manageGroupTH";
    }
View Full Code Here

    }

    @PreAuthorize("isDomainAdmin() or hasRole('ROLE_ADMIN')")
    @RequestMapping(value = "/manager/getGroupsForUser", method = RequestMethod.GET)
    public @ResponseBody List<GroupModel> getGroupsForUser() {
        User user = userService.getUserFromSecurityContext();

        List<GroupModel> models = new ArrayList<GroupModel>();

        for (Group group : userService.getAdministeredGroups(user, SortOrder.ASCENDING)) {
            models.add(groupService.createGroupModelWithOrganization(group, false, false));
View Full Code Here

    public
    @ResponseBody
    ManagerChecklist getManagerChecklist() {
        ManagerChecklist managerChecklist = new ManagerChecklist();
        Long orgId;
        User user = userService.getUserFromSecurityContext();
        if (user.getActiveOrganization() != null && user.isActiveOrganizationAdmin()) {
            orgId = user.getActiveOrganization().getId();
            managerChecklist = managerChecklistService.getManagerChecklist(orgId);
        }

        return managerChecklist;
    }
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.components.entities.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.