Package org.apache.syncope.client.mod

Examples of org.apache.syncope.client.mod.RoleMod


        roleTO = restTemplate.postForObject(BASE_URL + "role/create", roleTO, RoleTO.class);

        assertNotNull(roleTO);
        assertEquals(1, roleTO.getVirtualAttributes().size());

        final RoleMod roleMod = new RoleMod();
        roleMod.setId(roleTO.getId());
        roleMod.addVirtualAttributeToBeRemoved("rvirtualdata");

        roleTO = restTemplate.postForObject(BASE_URL + "role/update", roleMod, RoleTO.class);

        assertNotNull(roleTO);
        assertTrue(roleTO.getVirtualAttributes().isEmpty());
View Full Code Here


        roleTO = restTemplate.postForObject(BASE_URL + "role/create", roleTO, RoleTO.class);

        assertNotNull(roleTO);
        assertEquals(1, roleTO.getDerivedAttributes().size());

        final RoleMod roleMod = new RoleMod();
        roleMod.setId(roleTO.getId());
        roleMod.addDerivedAttributeToBeRemoved("rderivedschema");

        roleTO = restTemplate.postForObject(BASE_URL + "role/update", roleMod, RoleTO.class);

        assertNotNull(roleTO);
        assertTrue(roleTO.getDerivedAttributes().isEmpty());
View Full Code Here

        assertNotNull(actual);
        assertEquals("torename", actual.getName());
        assertEquals(0L, actual.getParent());

        RoleMod roleMod = new RoleMod();
        roleMod.setId(actual.getId());
        roleMod.setName("renamed");

        actual = restTemplate.postForObject(BASE_URL + "role/update", roleMod, RoleTO.class);

        assertNotNull(actual);
        assertEquals("renamed", actual.getName());
View Full Code Here

                    roleTO.setEntitlements(entitlementList);

                    if (createFlag) {
                        roleRestClient.createRole(roleTO);
                    } else {
                        RoleMod roleMod = AttributableOperations.diff(roleTO, originalRoleTO);

                        // update role just if it is changed
                        if (!roleMod.isEmpty()) {
                            roleRestClient.updateRole(roleMod);
                        }
                    }
                    ((Roles) pageRef.getPage()).setModalResult(true);
View Full Code Here

     * @param updated updated RoleTO
     * @param original original RoleTO
     * @return RoleMod containing differences
     */
    public static RoleMod diff(final RoleTO updated, final RoleTO original) {
        RoleMod result = new RoleMod();

        diff(updated, original, result, false);

        // 1. inheritance
        result.setInheritAccountPolicy(updated.isInheritAccountPolicy());
        result.setInheritPasswordPolicy(updated.isInheritPasswordPolicy());
        result.setInheritAttributes(updated.isInheritAttributes());
        result.setInheritDerivedAttributes(updated.isInheritDerivedAttributes());
        result.setInheritVirtualAttributes(updated.isInheritVirtualAttributes());

        // 2. policies
        ReferenceMod refAccountPolicy = new ReferenceMod();
        refAccountPolicy.setId(updated.getAccountPolicy());
        result.setAccountPolicy(refAccountPolicy);

        ReferenceMod refPasswordPolicy = new ReferenceMod();
        refPasswordPolicy.setId(updated.getPasswordPolicy());
        result.setPasswordPolicy(refPasswordPolicy);

        // 3. name
        if (!original.getName().equals(updated.getName())) {
            result.setName(updated.getName());
        }

        // 4. entitlements
        Set<String> updatedEnts = new HashSet<String>(updated.getEntitlements());
        Set<String> originalEnts = new HashSet<String>(original.getEntitlements());
        if (!updatedEnts.equals(originalEnts)) {
            result.setEntitlements(updated.getEntitlements());
        }

        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.syncope.client.mod.RoleMod

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.