Package org.zanata.model

Examples of org.zanata.model.HAccountRole


        hPerson.setEmail(from.getEmail());
        hPerson.setName(from.getName());

        to.getRoles().clear();
        for (String role : from.getRoles()) {
            HAccountRole hAccountRole = accountRoleDAO.findByName(role);
            if (hAccountRole == null) {
                // generate error for missing role
                log.debug("Invalid role '{}'", role);
                throw new NoLogWebApplicationException(Response
                        .status(Status.BAD_REQUEST)
View Full Code Here


        return (HAccountRole) cr.uniqueResult();
    }

    public HAccountRole create(String roleName, HAccountRole.RoleType type,
            String... includesRoles) {
        HAccountRole role = new HAccountRole();
        role.setName(roleName);
        role.setRoleType(type);
        for (String includeRole : includesRoles) {
            Set<HAccountRole> groups = role.getGroups();
            if (groups == null) {
                groups = new HashSet<HAccountRole>();
                role.setGroups(groups);
            }
            groups.add(findByName(includeRole));
        }
        makePersistent(role);
        return role;
View Full Code Here

        makePersistent(role);
        return role;
    }

    public List<HAccount> listMembers(String roleName) {
        HAccountRole role = findByName(roleName);
        return listMembers(role);
    }
View Full Code Here

            }

            for (String adminUsername : applicationConfiguration
                    .getAdminUsers()) {
                HAccount adminAccount = accountDAO.getByUsername(adminUsername);
                HAccountRole adminRole = accountRoleDAO.findByName("admin");
                if (adminAccount != null
                        && !adminAccount.getRoles().contains(adminRole)) {
                    log.info("Making user " + adminAccount.getUsername()
                            + " a system admin.");
                    adminAccount.getRoles().add(adminRole);
View Full Code Here

     *            The account that has just been created.
     */
    private void postProcessRegisteredAccount(final HAccount account) {
        if (applicationConfiguration.getAdminUsers().contains(
                account.getUsername())) {
            HAccountRole adminRole = accountRoleDAO.findByName("admin");
            if (adminRole != null) {
                account.getRoles().add(adminRole);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.zanata.model.HAccountRole

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.