if ( perms.length == 1 )
{ return permissionIsGranted(perms[0]); }
// Should never be.
if ( perms.length > 1 )
{ throw new AuthorizationException("Duplicate permissions for: " + perms[0]); }
// No permissions for this principal. Check inherited permissions.
boolean hasPermission = false;
try
{
Iterator i = service.getGroupMember(principal).getAllContainingGroups();
while ( i.hasNext() && ! hasPermission )
{
IAuthorizationPrincipal prn = service.newPrincipal( (IGroupMember) i.next() );
hasPermission = primDoesPrincipalHavePermission(prn, owner, activity, target, service);
}
}
catch ( GroupsException ge )
{ throw new AuthorizationException(ge); }
return hasPermission;
}