From 5a727de2032e90f9017775cf449019d69042a35b Mon Sep 17 00:00:00 2001 From: jennylee Date: Tue, 4 Jun 2013 13:26:06 -0400 Subject: [PATCH 1/2] BUG 11980. Change the Administrator User Role to Operator Rol. On Admin > Users > Roles > choose Operator or Manager Role > Users > Assign Users, click on Administrator from the Available Users List and then assign this to the Assigned Users List, PM allowed you assign the Administrator user to the Operator/Manager Role. Now PM shows a notification popup saying this is not allowed. --- workflow/engine/methods/roles/roles_Ajax.php | 6 ++++++ .../engine/templates/roles/rolesUsersPermission.js | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/workflow/engine/methods/roles/roles_Ajax.php b/workflow/engine/methods/roles/roles_Ajax.php index 061435b13..edd2a6b74 100755 --- a/workflow/engine/methods/roles/roles_Ajax.php +++ b/workflow/engine/methods/roles/roles_Ajax.php @@ -162,6 +162,12 @@ switch ($REQUEST) { foreach ($aUserIuds as $key => $val) { $sData['USR_UID'] = $val; $sData['ROL_UID'] = $ROL_UID; + if ($sData['USR_UID'] == '00000000000000000000000000000001') { + if ($sData['ROL_UID'] != 'PROCESSMAKER_ADMIN') { + echo '{userRole: true}'; + break; + } + } $RBAC->assignUserToRole( $sData ); } diff --git a/workflow/engine/templates/roles/rolesUsersPermission.js b/workflow/engine/templates/roles/rolesUsersPermission.js index e0dc61ce2..23f549ea4 100755 --- a/workflow/engine/templates/roles/rolesUsersPermission.js +++ b/workflow/engine/templates/roles/rolesUsersPermission.js @@ -753,7 +753,17 @@ SaveUsersRole = function(arr_usr, function_success, function_failure){ Ext.Ajax.request({ url: 'roles_Ajax', params: {request: 'assignUserToRole', ROL_UID: ROLES.ROL_UID, aUsers: arr_usr.join(',')}, - success: function(){ + success: function( result, request ){ + var data = Ext.util.JSON.decode(result.responseText); + if( data.userRole ) { + Ext.Msg.show({ + title: _('ID_WARNING'), + msg: _('ID_ADMINISTRATOR_ROLE_CANT_CHANGED'), + animEl: 'elId', + icon: Ext.MessageBox.WARNING, + buttons: Ext.MessageBox.OK + }); + } viewport.getEl().unmask(); function_success(); }, From cfd709e04bcdfe803485517d08eb4ebbb08222d3 Mon Sep 17 00:00:00 2001 From: jennylee Date: Tue, 4 Jun 2013 15:39:47 -0400 Subject: [PATCH 2/2] BUG 11980. Change the Administrator User Role to Operator Role. SOLVED On Admin > Users > Roles > choose Operator or Manager Role > Users > Assign Users, click on Administrator from the Available Users List and then assign this to the Assigned Users List, PM allowed you assign the Administrator user to the Operator/Manager Role. Now PM shows a notification popup saying this is not allowed. --- workflow/engine/methods/roles/roles_Ajax.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/workflow/engine/methods/roles/roles_Ajax.php b/workflow/engine/methods/roles/roles_Ajax.php index edd2a6b74..d3aba1ec9 100755 --- a/workflow/engine/methods/roles/roles_Ajax.php +++ b/workflow/engine/methods/roles/roles_Ajax.php @@ -164,7 +164,9 @@ switch ($REQUEST) { $sData['ROL_UID'] = $ROL_UID; if ($sData['USR_UID'] == '00000000000000000000000000000001') { if ($sData['ROL_UID'] != 'PROCESSMAKER_ADMIN') { - echo '{userRole: true}'; + $response = new stdclass(); + $response->userRole = true; + echo G::json_encode($response); break; } }