Package org.apache.syncope.core.persistence.beans

Examples of org.apache.syncope.core.persistence.beans.Entitlement


        return entityManager.merge(entitlement);
    }

    @Override
    public Entitlement saveEntitlementRole(final SyncopeRole role) {
        Entitlement roleEnt = new Entitlement();
        roleEnt.setName(EntitlementUtil.getEntitlementNameFromRoleId(role.getId()));
        roleEnt.setDescription("Entitlement for managing role " + role.getId());

        return save(roleEnt);
    }
View Full Code Here


        return save(roleEnt);
    }

    @Override
    public void delete(final String name) {
        Entitlement entitlement = find(name);
        if (entitlement == null) {
            return;
        }

        delete(entitlement);
View Full Code Here

        // attributes, derived attributes, virtual attributes and resources
        fill(role, roleTO, AttributableUtil.getInstance(AttributableType.ROLE), scce);

        // entitlements
        Entitlement entitlement;
        for (String entitlementName : roleTO.getEntitlements()) {
            entitlement = entitlementDAO.find(entitlementName);
            if (entitlement == null) {
                LOG.warn("Ignoring invalid entitlement {}", entitlementName);
            } else {
View Full Code Here

        // entitlements
        if (roleMod.getEntitlements() != null) {
            role.getEntitlements().clear();
            for (String entitlementName : roleMod.getEntitlements()) {
                Entitlement entitlement = entitlementDAO.find(entitlementName);
                if (entitlement == null) {
                    LOG.warn("Ignoring invalid entitlement {}", entitlementName);
                } else {
                    role.addEntitlement(entitlement);
                }
View Full Code Here

        assertEquals(entitlement, actual);
    }

    @Test
    public void delete() {
        Entitlement entitlement = entitlementDAO.find("base");
        assertNotNull("did not find expected entitlement", entitlement);

        List<SyncopeRole> roles = roleDAO.findByEntitlement(entitlement);
        assertEquals("expected two roles", 2, roles.size());
View Full Code Here

        assertEquals("did not get expected number of entitlements ", 82, list.size());
    }

    @Test
    public void findByName() {
        Entitlement entitlement = entitlementDAO.find("base");
        assertNotNull("did not find expected entitlement", entitlement);
    }
View Full Code Here

        assertNotNull("did not find expected entitlement", entitlement);
    }

    @Test
    public void save() {
        Entitlement entitlement = new Entitlement();
        entitlement.setName("another");

        entitlementDAO.save(entitlement);

        Entitlement actual = entitlementDAO.find("another");
        assertNotNull("expected save to work", actual);
        assertEquals(entitlement, actual);
    }
View Full Code Here

        assertEquals("did not get expected number of entitlements ", 80, list.size());
    }

    @Test
    public void findByName() {
        Entitlement entitlement = entitlementDAO.find("base");
        assertNotNull("did not find expected entitlement", entitlement);
    }
View Full Code Here

        assertNotNull("did not find expected entitlement", entitlement);
    }

    @Test
    public void save() {
        Entitlement entitlement = new Entitlement();
        entitlement.setName("another");

        entitlementDAO.save(entitlement);

        Entitlement actual = entitlementDAO.find("another");
        assertNotNull("expected save to work", actual);
        assertEquals(entitlement, actual);
    }
View Full Code Here

        assertEquals(entitlement, actual);
    }

    @Test
    public void delete() {
        Entitlement entitlement = entitlementDAO.find("base");
        assertNotNull("did not find expected entitlement", entitlement);

        List<SyncopeRole> roles = roleDAO.findByEntitlement(entitlement);
        assertEquals("expected two roles", 2, roles.size());
View Full Code Here

TOP

Related Classes of org.apache.syncope.core.persistence.beans.Entitlement

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.