- use highest access right if user is member of several groups

This commit is contained in:
steinm 2011-04-08 20:45:27 +00:00
parent 8d22e2635d
commit 02dc5e7215
2 changed files with 8 additions and 4 deletions

View File

@ -709,12 +709,14 @@ class LetoDMS_Core_Document { /* {{{ */
return $userAccess->getMode();
}
}
$result = $this->getDefaultAccess();
foreach ($accessList["groups"] as $groupAccess) {
if ($user->isMemberOfGroup($groupAccess->getGroup())) {
return $groupAccess->getMode();
if ($groupAccess->getMode()>$result)
$result = $groupAccess->getMode();
}
}
return $this->getDefaultAccess();
return $result;
} /* }}} */
/**

View File

@ -717,12 +717,14 @@ class LetoDMS_Core_Folder {
return $userAccess->getMode();
}
}
$result = $this->getDefaultAccess();
foreach ($accessList["groups"] as $groupAccess) {
if ($user->isMemberOfGroup($groupAccess->getGroup())) {
return $groupAccess->getMode();
if ($groupAccess->getMode()>$result)
$result = $groupAccess->getMode();
}
}
return $this->getDefaultAccess();
return $result;
} /* }}} */
/**