From 9a5d6c31ab0ed1a7a90f34a83f7c1c2f41d9ad20 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 3 Apr 2019 10:54:04 +0200 Subject: [PATCH 1/2] do not list users/groups in select menu which already has an access right --- views/bootstrap/class.DocumentAccess.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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"), From 029ac6d2d0663775f7fdd292a441d37a16a9dee2 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 3 Apr 2019 10:55:17 +0200 Subject: [PATCH 2/2] add item for 5.1.9 --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index c40bc3d3a..974e3099f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -32,6 +32,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