Examples of AccessControlEntry


Examples of org.exoplatform.services.jcr.access.AccessControlEntry

         case PropertyType.REFERENCE :
            Identifier identifier = new Identifier(value.getString());
            return new TransientValueData(identifier);
         case ExtendedPropertyType.PERMISSION :
            PermissionValue permValue = (PermissionValue)value;
            AccessControlEntry ace = new AccessControlEntry(permValue.getIdentity(), permValue.getPermission());
            return new TransientValueData(ace);
         default :
            throw new ValueFormatException("ValueFactory.convert() unknown or unconvertable type " + type);
      }
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.access.AccessControlEntry

         {
            do
            {
               StringTokenizer parser =
                  new StringTokenizer(new String(exoPerm.getBytes(COLUMN_VDATA)), AccessControlEntry.DELIMITER);
               naPermissions.add(new AccessControlEntry(parser.nextToken(), parser.nextToken()));
            }
            while (exoPerm.next());

            return naPermissions;
         }
View Full Code Here

Examples of org.exoplatform.services.jcr.access.AccessControlEntry

      checkPermission(PermissionType.CHANGE_PERMISSION);

      List<AccessControlEntry> aces = new ArrayList<AccessControlEntry>();
      for (String perm : PermissionType.ALL)
      {
         AccessControlEntry ace = new AccessControlEntry(SystemIdentity.ANY, perm);
         aces.add(ace);
      }
      AccessControlList acl = new AccessControlList(getACL().getOwner(), aces);

      setACL(acl);
View Full Code Here

Examples of org.exoplatform.services.jcr.access.AccessControlEntry

      List<AccessControlEntry> listEntry = new ArrayList<AccessControlEntry>();

      for (AccessControlEntry aEntry : nodeData().getACL().getPermissionEntries())
      {
         listEntry.add(new AccessControlEntry(aEntry.getIdentity(), aEntry.getPermission()));
      }

      return new AccessControlList(nodeData().getACL().getOwner(), listEntry);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.access.AccessControlEntry

            throw new RepositoryException("Permissions cannot be null");
         }

         for (int j = 0; j < perm.length; j++)
         {
            AccessControlEntry ace = new AccessControlEntry(identity, perm[j]);
            aces.add(ace);
         }
      }

      AccessControlList acl = new AccessControlList(getACL().getOwner(), aces);
View Full Code Here

Examples of org.exoplatform.services.jcr.access.AccessControlEntry

         case PropertyType.REFERENCE :
            Identifier identifier = new Identifier(value.getString());
            return new TransientValueData(identifier);
         case ExtendedPropertyType.PERMISSION :
            PermissionValue permValue = (PermissionValue)value;
            AccessControlEntry ace = new AccessControlEntry(permValue.getIdentity(), permValue.getPermission());
            return new TransientValueData(ace);
         default :
            throw new ValueFormatException("ValueFactory.convert() unknown or unconvertable type " + type);
      }
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.access.AccessControlEntry

               new TransientValueData(acl.getOwner()));

         List<ValueData> permsValues = new ArrayList<ValueData>();
         for (int i = 0; i < acl.getPermissionEntries().size(); i++)
         {
            AccessControlEntry entry = acl.getPermissionEntries().get(i);
            permsValues.add(new TransientValueData(entry));
         }
         TransientPropertyData exoPerms =
            TransientPropertyData.createPropertyData(rootNode, Constants.EXO_PERMISSIONS,
               ExtendedPropertyType.PERMISSION, true, permsValues);
View Full Code Here

Examples of org.exoplatform.services.jcr.access.AccessControlEntry

               new TransientValueData(acl.getOwner()));

         List<ValueData> permsValues = new ArrayList<ValueData>();
         for (int i = 0; i < acl.getPermissionEntries().size(); i++)
         {
            AccessControlEntry entry = acl.getPermissionEntries().get(i);
            permsValues.add(new TransientValueData(entry));
         }
         TransientPropertyData exoPerms =
            TransientPropertyData.createPropertyData(jcrSystem, Constants.EXO_PERMISSIONS,
               ExtendedPropertyType.PERMISSION, true, permsValues);

         changesLog.add(ItemState.createAddedState(exoMixinTypes)).add(ItemState.createAddedState(exoOwner)).add(
            ItemState.createAddedState(exoPerms));
         changesLog.add(new ItemState(jcrSystem, ItemState.MIXIN_CHANGED, false, null));
      }
      else
      {
         jcrSystem =
            TransientNodeData.createNodeData(root, Constants.JCR_SYSTEM, Constants.NT_UNSTRUCTURED,
               Constants.SYSTEM_UUID);

         TransientPropertyData primaryType =
            TransientPropertyData.createPropertyData(jcrSystem, Constants.JCR_PRIMARYTYPE, PropertyType.NAME, false,
               new TransientValueData(jcrSystem.getPrimaryTypeName()));

         changesLog.add(ItemState.createAddedState(jcrSystem)).add(ItemState.createAddedState(primaryType));
      }

      // init version storage
      AccessControlList acl = new AccessControlList();
      acl.removePermissions(SystemIdentity.ANY);
      acl.addPermissions(SystemIdentity.ANY, new String[]{PermissionType.READ});

      for (AccessControlEntry entry : jcrSystem.getACL().getPermissionEntries())
      {
         String identity = entry.getIdentity();
         String permission = entry.getPermission();

         if (!identity.equals(SystemIdentity.ANY) || !permission.equals(PermissionType.READ))
         {
            acl.addPermissions(identity, new String[]{permission});
         }
      }

      TransientNodeData versionStorageNodeData =
         TransientNodeData.createNodeData(jcrSystem, Constants.JCR_VERSIONSTORAGE, Constants.EXO_VERSIONSTORAGE,
            Constants.VERSIONSTORAGE_UUID, acl);

      TransientPropertyData vsPrimaryType =
         TransientPropertyData.createPropertyData(versionStorageNodeData, Constants.JCR_PRIMARYTYPE, PropertyType.NAME,
            false, new TransientValueData(versionStorageNodeData.getPrimaryTypeName()));

      TransientPropertyData exoMixinTypes =
         TransientPropertyData.createPropertyData(versionStorageNodeData, Constants.JCR_MIXINTYPES, PropertyType.NAME,
            true, new TransientValueData(Constants.EXO_PRIVILEGEABLE));

      List<ValueData> permsValues = new ArrayList<ValueData>();
      for (int i = 0; i < acl.getPermissionEntries().size(); i++)
      {
         AccessControlEntry entry = acl.getPermissionEntries().get(i);
         permsValues.add(new TransientValueData(entry));
      }
      TransientPropertyData exoPerms =
         TransientPropertyData.createPropertyData(versionStorageNodeData, Constants.EXO_PERMISSIONS,
            ExtendedPropertyType.PERMISSION, true, permsValues);
View Full Code Here

Examples of org.exoplatform.services.jcr.access.AccessControlEntry

         {
            do
            {
               StringTokenizer parser =
                  new StringTokenizer(new String(exoPerm.getBytes(COLUMN_VDATA)), AccessControlEntry.DELIMITER);
               naPermissions.add(new AccessControlEntry(parser.nextToken(), parser.nextToken()));
            }
            while (exoPerm.next());

            return naPermissions;
         }
View Full Code Here

Examples of org.exoplatform.services.jcr.access.AccessControlEntry

      {
         for (TempPropertyData value : permValues)
         {
            StringTokenizer parser =
               new StringTokenizer(new String(value.getValueData().getAsByteArray()), AccessControlEntry.DELIMITER);
            naPermissions.add(new AccessControlEntry(parser.nextToken(), parser.nextToken()));
         }

         return naPermissions;
      }
      else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.