diff --git a/CHANGELOG b/CHANGELOG
index dcae233c9..b94525268 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -144,6 +144,8 @@
via restapi
- add an input field on the substitute user and extension list page for filtering
table rows by string
+- do not list users/groups in select menu on DocumentAccess page which already
+ has an access right
--------------------------------------------------------------------------------
Changes in version 5.1.9
diff --git a/views/bootstrap/class.DocumentAccess.php b/views/bootstrap/class.DocumentAccess.php
index 8753f4cac..f45241a4a 100644
--- a/views/bootstrap/class.DocumentAccess.php
+++ b/views/bootstrap/class.DocumentAccess.php
@@ -189,11 +189,16 @@ $(document).ready( function() {
getUser();
+ $memusers[] = $userObj->getID();
+ }
$options = array();
$options[] = array(-1, getMLText('select_one'));
foreach ($allUsers as $currUser) {
- if (!$currUser->isGuest())
- $options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()), ($currUser->getID()==$user->getID()), array(array('data-subtitle', htmlspecialchars($currUser->getFullName()))));
+ if (!$currUser->isGuest() && !in_array($currUser->getID(), $memusers))
+ $options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()), false, array(array('data-subtitle', htmlspecialchars($currUser->getFullName()))));
}
$this->formField(
getMLText("user"),
@@ -204,10 +209,16 @@ $(document).ready( function() {
'options'=>$options
)
);
+ $memgroups = array();
+ foreach ($accessList["groups"] as $groupAccess) {
+ $groupObj = $groupAccess->getGroup();
+ $memgroups[] = $groupObj->getID();
+ }
$options = array();
$options[] = array(-1, getMLText('select_one'));
foreach ($allGroups as $groupObj) {
- $options[] = array($groupObj->getID(), htmlspecialchars($groupObj->getName()));
+ if(!in_array($groupObj->getID(), $memgroups))
+ $options[] = array($groupObj->getID(), htmlspecialchars($groupObj->getName()));
}
$this->formField(
getMLText("group"),