Author: jfthomps
Date: Thu Aug 10 20:12:10 2017
New Revision: 1804721

URL: http://svn.apache.org/viewvc?rev=1804721&view=rev
Log:
VCL-1077 - Adding an AD Domain to the privilege tree with available or 
manageMapping set causes it to be added with no way to remove it

privilege.php: modified AJsubmitAddResourcePriv: added checks to prevent 
invalid privileges from being assigned for certain types; updated error message 
to say no privileges specified or the ones specified don't apply for the given 
type

Modified:
    vcl/trunk/web/.ht-inc/privileges.php

Modified: vcl/trunk/web/.ht-inc/privileges.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/privileges.php?rev=1804721&r1=1804720&r2=1804721&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/privileges.php (original)
+++ vcl/trunk/web/.ht-inc/privileges.php Thu Aug 10 20:12:10 2017
@@ -3412,12 +3412,16 @@ function AJsubmitAddResourcePriv() {
        $privtypes = getResourcePrivs();
        $newgroupprivs = array();
        foreach($privtypes as $type) {
+               if(($newtype == 'addomain' && ($type == 'available' || $type == 
'manageMapping')) ||
+                  ($newtype == 'schedule' && ($type == 'available' || $type == 
'manageMapping')) ||
+                  ($newtype == 'managementnode' && $type == 'available'))
+                       continue;
                if(in_array($type, $perms))
                        array_push($newgroupprivs, $type);
        }
        if(empty($newgroupprivs) || (count($newgroupprivs) == 1 && 
           in_array("cascade", $newgroupprivs))) {
-               $text = "<font color=red>No resource group privileges were 
specified</font>";
+               $text = "<font color=red>No resource group privileges were 
specified or privileges do not<br>apply to the specified type</font>";
                print setAttribute('addResourceGroupPrivStatus', 'innerHTML', 
$text);
                return;
        }


Reply via email to