com.microsoft.schemas.sharepoint.soap.directory.PermissionsSoap aclCall = aclService.getPermissionsSoapHandler( );
com.microsoft.schemas.sharepoint.soap.directory.GetPermissionCollectionResponseGetPermissionCollectionResult aclResult = aclCall.getPermissionCollection( docLib, "List" );
org.apache.axis.message.MessageElement[] aclList = aclResult.get_any();
XMLDoc doc = new XMLDoc( aclList[0].toString() );
ArrayList nodeList = new ArrayList();
doc.processPath(nodeList, "*", null);
if (nodeList.size() != 1)
{
throw new ManifoldCFException("Bad xml - missing outer 'ns1:GetPermissionCollection' node - there are "+Integer.toString(nodeList.size())+" nodes");
}
Object parent = nodeList.get(0);
if (!doc.getNodeName(parent).equals("ns1:GetPermissionCollection"))
throw new ManifoldCFException("Bad xml - outer node is not 'ns1:GetPermissionCollection'");
nodeList.clear();
doc.processPath(nodeList, "*", parent);
if ( nodeList.size() != 1 )
{
throw new ManifoldCFException( " No results found." );
}
parent = nodeList.get(0);
nodeList.clear();
doc.processPath( nodeList, "*", parent );
java.util.HashSet sids = new java.util.HashSet();
int i = 0;
for (; i< nodeList.size(); i++ )
{
Object node = nodeList.get( i );
String mask = doc.getValue( node, "Mask" );
long maskValue = new Long(mask).longValue();
if ((maskValue & 1L) == 1L)
{
// Permission to view
String isUser = doc.getValue( node, "MemberIsUser" );
if ( isUser.compareToIgnoreCase("True") == 0 )
{
// Use AD user or group
String userLogin = doc.getValue( node, "UserLogin" );
String userSid = getSidForUser( userCall, userLogin );
sids.add( userSid );
}
else
{
// Role
String[] roleSids;
String roleName = doc.getValue( node, "RoleName" );
if ( roleName.length() == 0)
{
roleName = doc.getValue(node,"GroupName");
roleSids = getSidsForGroup(userCall, roleName);
}
else
{
roleSids = getSidsForRole(userCall, roleName);