Package org.apache.chemistry.opencmis.commons.impl.dataobjects

Examples of org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlEntryImpl


            for (String s : e.getValue()) {
                permissions.add(s);
            }

            AccessControlEntryImpl ace = new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(e.getKey()),
                    permissions);

            aces.add(ace);
        }
View Full Code Here


        for (CmisAccessControlEntryType entry : acl.getPermission()) {
            if (entry == null) {
                continue;
            }

            AccessControlEntryImpl ace = new AccessControlEntryImpl();
            ace.setDirect(entry.isDirect());
            ace.setPermissions(entry.getPermission());
            AccessControlPrincipalDataImpl principal = new AccessControlPrincipalDataImpl(
                    entry.getPrincipal() == null ? null : entry.getPrincipal().getPrincipalId());
            convertExtension(entry.getPrincipal(), principal);
            ace.setPrincipal(principal);

            // handle extensions
            convertExtension(entry, ace);

            aces.add(ace);
View Full Code Here

            // create principal
            AccessControlPrincipalDataImpl principal = new AccessControlPrincipalDataImpl();
            principal.setPrincipalId(ue.getKey());

            // create ACE
            AccessControlEntryImpl entry = new AccessControlEntryImpl();
            entry.setPrincipal(principal);
            entry.setPermissions(new ArrayList<String>());
            entry.getPermissions().add(CMIS_READ);
            if (!ue.getValue().booleanValue() && file.canWrite()) {
                entry.getPermissions().add(CMIS_WRITE);
                entry.getPermissions().add(CMIS_ALL);
            }

            entry.setDirect(true);

            // add ACE
            result.getAces().add(entry);
        }
View Full Code Here

        List<Ace> aces = new ArrayList<Ace>();

        int i = 0;
        for (String principalId : principals) {
            aces.add(new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(principalId), controlParser
                    .getValues(CONTROL_ADD_ACE_PERMISSION, i)));
            i++;
        }

        return new AccessControlListImpl(aces);
View Full Code Here

        List<Ace> aces = new ArrayList<Ace>();

        int i = 0;
        for (String principalId : principals) {
            aces.add(new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(principalId), controlParser
                    .getValues(CONTROL_REMOVE_ACE_PERMISSION, i)));
            i++;
        }

        return new AccessControlListImpl(aces);
View Full Code Here

            for (String s : e.getValue()) {
                permissions.add(s);
            }

            AccessControlEntryImpl ace = new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(e.getKey()),
                    permissions);

            aces.add(ace);
        }
View Full Code Here

        for (CmisAccessControlEntryType entry : acl.getPermission()) {
            if (entry == null) {
                continue;
            }

            AccessControlEntryImpl ace = new AccessControlEntryImpl();
            ace.setDirect(entry.isDirect());
            ace.setPermissions(entry.getPermission());
            AccessControlPrincipalDataImpl principal = new AccessControlPrincipalDataImpl(
                    entry.getPrincipal() == null ? null : entry.getPrincipal().getPrincipalId());
            convertExtension(entry.getPrincipal(), principal);
            ace.setPrincipal(principal);

            // handle extensions
            convertExtension(entry, ace);

            aces.add(ace);
View Full Code Here

                ace.getValue().removeAll(removePermissions);
            }

            // create new ACE
            if (!ace.getValue().isEmpty()) {
                newAces.add(new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(ace.getKey()),
                        new ArrayList<String>(ace.getValue())));
            }
        }

        // find all ACEs that should be added but are not in the original ACE
        // list
        for (Map.Entry<String, Set<String>> ace : adds.entrySet()) {
            if (!originals.containsKey(ace.getKey()) && !ace.getValue().isEmpty()) {
                newAces.add(new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(ace.getKey()),
                        new ArrayList<String>(ace.getValue())));
            }
        }

        return new AccessControlListImpl(newAces);
View Full Code Here

                ace.getValue().removeAll(removePermissions);
            }

            // create new ACE
            if (!ace.getValue().isEmpty()) {
                newAces.add(new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(ace.getKey()),
                        new ArrayList<String>(ace.getValue())));
            }
        }

        // find all ACEs that should be added but are not in the original ACE
        // list
        for (Map.Entry<String, Set<String>> ace : adds.entrySet()) {
            if (!originals.containsKey(ace.getKey()) && !ace.getValue().isEmpty()) {
                newAces.add(new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(ace.getKey()),
                        new ArrayList<String>(ace.getValue())));
            }
        }

        return new AccessControlListImpl(newAces);
View Full Code Here

            for (String s : e.getValue()) {
                permissions.add(s);
            }

            AccessControlEntryImpl ace = new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(e.getKey()),
                    permissions);

            aces.add(ace);
        }
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlEntryImpl

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.