@ -168,7 +168,7 @@ def v1_2_0_Monitor_ControlPanelDictGet(inRequest,inGlobalDict):
return bytes ( message , " utf8 " )
from . import Orchestrator # For user defs
from . import __ Orchestrator__ # For user defs
@ -177,7 +177,7 @@ from . import Orchestrator # For user defs
def v1_2_0_ProcessorOld2NewActivityDict ( inActivityOld ) :
if inActivityOld [ " Type " ] == " WindowsLogon " :
lResult = {
" Def " : Orchestrator. OSCredentialsVerify , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" Def " : __ Orchestrator__ . OSCredentialsVerify , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inUserStr " : inActivityOld [ " User " ] , " inPasswordStr " : inActivityOld [ " Password " ] , " inDomainStr " : inActivityOld [ " Domain " ] } , # Args dictionary
" ArgGSettings " : None , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -185,7 +185,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
}
elif inActivityOld [ " Type " ] == " GlobalDictKeyListValueGet " :
lResult = {
" Def " : Orchestrator. GSettingsKeyListValueGet , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" Def " : __ Orchestrator__ . GSettingsKeyListValueGet , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inKeyList " : inActivityOld [ " KeyList " ] } , # Args dictionary
" ArgGSettings " : " inGSettings " , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -193,7 +193,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
}
elif inActivityOld [ " Type " ] == " CMDStart " :
lResult = {
" Def " : Orchestrator. OSCMD , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" Def " : __ Orchestrator__ . OSCMD , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inCMDStr " : inActivityOld [ " Command " ] } , # Args dictionary
" ArgGSettings " : None , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -201,7 +201,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
}
elif inActivityOld [ " Type " ] == " OrchestratorRestart " :
lResult = {
" Def " : Orchestrator. OrchestratorRestart , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" Def " : __ Orchestrator__ . OrchestratorRestart , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { } , # Args dictionary
" ArgGSettings " : " inGSettings " , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -209,7 +209,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
}
elif inActivityOld [ " Type " ] == " OrchestratorSessionSave " :
lResult = {
" Def " : Orchestrator. OrchestratorSessionSave ,
" Def " : __ Orchestrator__ . OrchestratorSessionSave ,
# def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { } , # Args dictionary
@ -218,7 +218,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
}
elif inActivityOld [ " Type " ] == " GlobalDictKeyListValueSet " :
lResult = {
" Def " : Orchestrator. GSettingsKeyListValueSet , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" Def " : __ Orchestrator__ . GSettingsKeyListValueSet , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inKeyList " : inActivityOld [ " KeyList " ] , " inValue " : inActivityOld [ " Value " ] } , # Args dictionary
" ArgGSettings " : " inGSettings " , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -226,7 +226,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
}
elif inActivityOld [ " Type " ] == " GlobalDictKeyListValueAppend " :
lResult = {
" Def " : Orchestrator. GSettingsKeyListValueAppend , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" Def " : __ Orchestrator__ . GSettingsKeyListValueAppend , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inKeyList " : inActivityOld [ " KeyList " ] , " inValue " : inActivityOld [ " Value " ] } , # Args dictionary
" ArgGSettings " : " inGSettings " , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -234,7 +234,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
}
elif inActivityOld [ " Type " ] == " GlobalDictKeyListValueOperator+ " :
lResult = {
" Def " : Orchestrator. GSettingsKeyListValueOperatorPlus , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" Def " : __ Orchestrator__ . GSettingsKeyListValueOperatorPlus , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inKeyList " : inActivityOld [ " KeyList " ] , " inValue " : inActivityOld [ " Value " ] } , # Args dictionary
" ArgGSettings " : None , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -242,7 +242,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
}
elif inActivityOld [ " Type " ] == " ProcessStart " :
lResult = {
" Def " : Orchestrator. ProcessStart , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" Def " : __ Orchestrator__ . ProcessStart , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inPathStr " : inActivityOld [ " Path " ] , " inArgList " : inActivityOld [ " ArgList " ] } , # Args dictionary
" ArgGSettings " : None , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -250,7 +250,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
}
elif inActivityOld [ " Type " ] == " ProcessStartIfTurnedOff " :
lResult = {
" Def " : Orchestrator. ProcessStart , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" Def " : __ Orchestrator__ . ProcessStart , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inPathStr " : inActivityOld [ " Path " ] , " inArgList " : inActivityOld [ " ArgList " ] , " inStopProcessNameWOExeStr " : inActivityOld [ " CheckTaskName " ] } , # Args dictionary
" ArgGSettings " : None , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -258,7 +258,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
}
elif inActivityOld [ " Type " ] == " ProcessStop " :
lResult = {
" Def " : Orchestrator. ProcessStop , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" Def " : __ Orchestrator__ . ProcessStop , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inProcessNameWOExeStr " : inActivityOld [ " Name " ] , " inCloseForceBool " : inActivityOld [ " FlagForce " ] , " inUserNameStr " : inActivityOld [ " User " ] } , # Args dictionary
" ArgGSettings " : None , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -266,7 +266,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
}
elif inActivityOld [ " Type " ] == " PythonStart " :
lResult = {
" Def " : Orchestrator. PythonStart , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" Def " : __ Orchestrator__ . PythonStart , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inModulePathStr " : inActivityOld [ " ModuleName " ] , " inDefNameStr " : inActivityOld [ " FunctionName " ] , " inArgList " : inActivityOld [ " ArgList " ] ,
" inArgDict " : inActivityOld [ " ArgDict " ] } , # Args dictionary
@ -316,7 +316,7 @@ def Update(inGSettings):
}
}
if lL : lL . warning ( f " Backward compatibility (v1.1.13 to v1.1.14): Add default ' Client ' structure " ) # Log about compatibility
if " RequestTimeoutSecFloat" not in inGSettings [ " Server " ] : # Add Server > "RequestTimeoutSecFloat" property
if " Server" in inGSettings and " RequestTimeoutSecFloat" not in inGSettings [ " Server " ] : # Add Server > "RequestTimeoutSecFloat" property
inGSettings [ " Server " ] [ " RequestTimeoutSecFloat " ] = 300 # Time to handle request in seconds
if lL : lL . warning (
f " Backward compatibility (v1.1.13 to v1.1.14): Add default ' Server ' > ' RequestTimeoutSecFloat ' property " ) # Log about compatibility
@ -366,24 +366,25 @@ def Update(inGSettings):
# lUserRights = inGSettings["Server"]["AccessUsers"]["RuleDomainUserDict"][(inRequest.OpenRPA["Domain"].upper(), inRequest.OpenRPA["User"].upper())]
# if len(lUserRights["ControlPanelKeyAllowedList"]) > 0 and lItem["KeyStr"] not in lUserRights["ControlPanelKeyAllowedList"]:
# lUACBool = False # UAC Check is not passed - False for user
lShowWarnBool = False
# # Convert to UACClient dict
lRuleDomainUserDeepCopyDict = copy . deepcopy ( inGSettings [ " Server " ] [ " AccessUsers " ] [ " RuleDomainUserDict " ] )
for lItemKeyTurple in lRuleDomainUserDeepCopyDict :
lDomainUpperStr = lItemKeyTurple [ 0 ]
lUserUpperStr = lItemKeyTurple [ 1 ]
lItemDict = lRuleDomainUserDeepCopyDict [ lItemKeyTurple ]
if " ControlPanelKeyAllowedList " in lItemDict :
lShowWarnBool = True
lUACClientDict = { " pyOpenRPADict " : { " CPKeyDict " : { } } }
for lAllowedKeyItemStr in lItemDict [ " ControlPanelKeyAllowedList " ] :
lUACClientDict [ " pyOpenRPADict " ] [ " CPKeyDict " ] [ lAllowedKeyItemStr ] = True # Convert
# Send update UACDict for user by the list
Orchestrator . OrchestratorUACUpdate ( inGSettings = inGSettings , inADLoginStr = lUserUpperStr , inADStr = lDomainUpperStr , inRoleHierarchyAllowedDict = lUACClientDict )
# remove "ControlPanelKeyAllowedList"
del inGSettings [ " Server " ] [ " AccessUsers " ] [ " RuleDomainUserDict " ] [ lItemKeyTurple ] [ " ControlPanelKeyAllowedList " ]
if lShowWarnBool : # Show only 1 warning per all run
if lL : lL . warning ( f " Backward compatibility (v1.1.20 to v1.2.0): Convert CP allowed list to UAC Client hierarchy (consolidated) " ) # Log about compatibility
if " Server " in inGSettings :
lShowWarnBool = False
lRuleDomainUserDeepCopyDict = copy . deepcopy ( inGSettings [ " Server " ] [ " AccessUsers " ] [ " RuleDomainUserDict " ] )
for lItemKeyTurple in lRuleDomainUserDeepCopyDict :
lDomainUpperStr = lItemKeyTurple [ 0 ]
lUserUpperStr = lItemKeyTurple [ 1 ]
lItemDict = lRuleDomainUserDeepCopyDict [ lItemKeyTurple ]
if " ControlPanelKeyAllowedList " in lItemDict :
lShowWarnBool = True
lUACClientDict = { " pyOpenRPADict " : { " CPKeyDict " : { } } }
for lAllowedKeyItemStr in lItemDict [ " ControlPanelKeyAllowedList " ] :
lUACClientDict [ " pyOpenRPADict " ] [ " CPKeyDict " ] [ lAllowedKeyItemStr ] = True # Convert
# Send update UACDict for user by the list
__Orchestrator__ . OrchestratorUACUpdate ( inGSettings = inGSettings , inADLoginStr = lUserUpperStr , inADStr = lDomainUpperStr , inRoleHierarchyAllowedDict = lUACClientDict )
# remove "ControlPanelKeyAllowedList"
del inGSettings [ " Server " ] [ " AccessUsers " ] [ " RuleDomainUserDict " ] [ lItemKeyTurple ] [ " ControlPanelKeyAllowedList " ]
if lShowWarnBool : # Show only 1 warning per all run
if lL : lL . warning ( f " Backward compatibility (v1.1.20 to v1.2.0): Convert CP allowed list to UAC Client hierarchy (consolidated) " ) # Log about compatibility
# Check if ControlPanelDict is active > convert to CPDict
if " ControlPanelDict " in inGSettings :
if " CPDict " not in inGSettings : inGSettings [ " CPDict " ] = { }