code: public void setPermissions(Map permissions) throws RepositoryException, AccessDeniedException,
        AccessControlException
     {
        checkValid();
  
        if (!isNodeType(Constants.EXO_PRIVILEGEABLE))
        {
           throw new AccessControlException("Node is not exo:privilegeable " + getPath());
        }
  
        if (permissions.size() == 0)
        {
           throw new RepositoryException("Permission map size cannot be 0");
        }
  
        checkPermission(PermissionType.CHANGE_PERMISSION);
  
        List<AccessControlEntry> aces = new ArrayList<AccessControlEntry>();
        for (Iterator<String> i = permissions.keySet().iterator(); i.hasNext();)
        {
           String identity = i.next();
           if (identity == null)
           {
              throw new RepositoryException("Identity cannot be null");
           }
  
           String[] perm = (String[])permissions.get(identity);
           if (perm == null)
           {
              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);
        setACL(acl);
        updatePermissions(acl);
     }
docs: {@inheritDoc}