Package org.openengsb.core.services.internal.security.model

Examples of org.openengsb.core.services.internal.security.model.PermissionData


        if (permission == null) {
            return;
        }
        Collection<PermissionData> pd = new LinkedList<PermissionData>();
        for (Permission p : permission) {
            PermissionData data = PermissionUtils.convertPermissionToPermissionData(p);
            pd.add(data);
        }
        List<Entry> permissionStructure = EntryFactory.permissionStructureFromPermissionData(pd, parent);
        dao.store(permissionStructure);
    }
View Full Code Here


                EntryValue entryValue = new EntryValue(key, entryElements);
                attributes.put(key, entryValue); // TODO why need key 2x?
            }
            String type = LdapUtils.extractAttributeEmptyCheck(permission.getEntry(),
                    SchemaConstants.JAVA_CLASS_NAME_ATTRIBUTE);
            PermissionData data = new PermissionData();
            data.setType(type);
            data.setAttributes(attributes);
            permissionData.add(data);
        }
        return EntryUtils.convertAllBeanDataToObjects(permissionData);
    }
View Full Code Here

        UserData user = doFindUser(username);
        addPermissionsToSet(user.getPermissionSet(), permission);
    }

    private static PermissionData convertPermissionToPermissionData(Permission permission) {
        PermissionData permissionData = new PermissionData();
        String type = permission.getClass().getName();
        permissionData.setType(type);
        Map<String, EntryValue> entryMap = EntryUtils.convertBeanToEntryMap(permission);

        // copy the map, because JPA does not like the transformed map for some reason
        entryMap = Maps.newHashMap(entryMap);
        permissionData.setAttributes(entryMap);
        return permissionData;
    }
View Full Code Here

        addPermissionsToSet(set, permission);
    }

    private void addPermissionsToSet(PermissionSetData set, Permission... permission) {
        for (Permission p : permission) {
            PermissionData data = convertPermissionToPermissionData(p);
            set.getPermissions().add(data);
        }
        synchronized (entityManager) {
            entityManager.merge(set);
        }
View Full Code Here

        return result;
    }

    private void doRemovePermissionsFromSet(PermissionSetData set, Permission... permission) {
        for (Permission p : permission) {
            PermissionData data = convertPermissionToPermissionData(p);
            set.getPermissions().remove(data);
        }
        synchronized (entityManager) {
            entityManager.merge(set);
        }
View Full Code Here

    /**
     * Converts a {@link Permission} into {@link PermissionData} to allow easier storing of the permission.
     */
    public static PermissionData convertPermissionToPermissionData(Permission permission) {
        PermissionData permissionData = new PermissionData();
        String type = permission.getClass().getName();
        permissionData.setType(type);
        Map<String, EntryValue> entryMap = EntryUtils.convertBeanToEntryMap(permission);

        // copy the map, because JPA does not like the transformed map for some reason
        entryMap = Maps.newHashMap(entryMap);
        permissionData.setAttributes(entryMap);
        return permissionData;
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.services.internal.security.model.PermissionData

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.