boolean hasUseRight = false;
Iterator iter = perms.iterator();
while (iter.hasNext()) {
try {
AccessPermission perm = (AccessPermission) iter.next();
LOGGER.log(Level.FINEST, "Checking access rights for {0} user: "
+ "grantee[{1}], access mask[{2}], constraint mask[{3}]",
new Object[] {user.get_Name(), perm.get_GranteeName(),
perm.get_AccessMask(), constraintMask});
if ((perm.get_AccessMask() & USE_MARKING) == USE_MARKING) {
if (hasUseRight == false
&& AccessType.ALLOW.equals(perm.get_AccessType())
&& matchesUser(perm, user)) {
hasUseRight = true;
} else if (AccessType.DENY.equals(perm.get_AccessType())
&& (AccessLevel.FULL_CONTROL_AS_INT == constraintMask)
&& matchesUser(perm, user)) {
LOGGER.log(Level.FINE, "User: [{0}] has Deny USE right and Deny "
+ "all access rights over the document", user.get_Name());
return false;