Webservices to modify folder acl

How does one go about using webservices to modify folder acls? I’ve gotten to the point where I can determine if the user has access (read, write, admin) but can’t figure out how to set access. (trying to use setPermissions gives me a “new ACL entry…from the source ACL must not be persisted”)


IPSGuid itemGuid = gmgr.makeGuid(new PSLocator(folderID));
List guidList = Collections.singletonList(itemGuid); 
				
// List< PSFolder >
List folderList = cws.loadFolders(guidList);
if(folderList.size()>0){				
  PSFolder firstFolder = (PSFolder) folderList.get(0);
  output += "found a folder. path: " + firstFolder.getFolderPath() ;

  PSObjectPermissions fperm = firstFolder.getPermissions();
  output += "permissions admin: " +  fperm.hasAdminAccess();
}

The problem we are trying to address is that “web_admins” of a particular community can have folders hidden from them or made unmodifiable by regular users (authors, editors). We were thinking of writing a menu action that hits a jsp that will allow web_admins to be added to the (selected) folder acls as an admin. Using IPSAclService does not seem to work either as the function loadAclForObject (or any of the loads for that matter) on the folder guid returns a null object.