@ -20,16 +20,19 @@ from . import SettingsTemplate
# Generate CP
# Generate CP
# Return {"Key":{"",""}}
# Return {"Key":{"",""}}
def HiddenCPDictGenerate ( inRequest , inGSettings ) :
def HiddenCPDictGenerate ( inRequest , inGSettings ) :
dUAC = inRequest . UACClientCheck # Alias.
lUACCPTemplateKeyList = [ " pyOpenRPADict " , " CPKeyDict " ]
lL = inGSettings [ " Logger " ] # Alias for logger
lL = inGSettings [ " Logger " ] # Alias for logger
# Create result JSON
# Create result JSON
lCPDict = { }
lCPDict = { }
lRenderFunctionsRobotList = inGSettings [ " ControlPanelDict " ] [ " RobotList " ]
lRenderFunctionsRobotList = inGSettings [ " ControlPanelDict " ] [ " RobotList " ]
for lItem in lRenderFunctionsRobotList :
for lItem in lRenderFunctionsRobotList :
lUACBool = True # Check if render function is applicable User Access Rights (UAC)
lUACBool = dUAC ( inRoleKeyList = lUACCPTemplateKeyList + [ lItem [ " KeyStr " ] ] ) # Check if render function is applicable User Access Rights (UAC)
if inGSettings [ " Server " ] [ " AccessUsers " ] [ " FlagCredentialsAsk " ] is True :
if lItem [ " KeyStr " ] == " VersionCheck " : lUACBool = True # For backward compatibility for the old fron version which not reload page when new orch version is comming
lUserRights = inGSettings [ " Server " ] [ " AccessUsers " ] [ " RuleDomainUserDict " ] [ ( inRequest . OpenRPA [ " Domain " ] . upper ( ) , inRequest . OpenRPA [ " User " ] . upper ( ) ) ]
#if inGSettings["Server"]["AccessUsers"]["FlagCredentialsAsk"] is True:
if len ( lUserRights [ " ControlPanelKeyAllowedList " ] ) > 0 and lItem [ " KeyStr " ] not in lUserRights [ " ControlPanelKeyAllowedList " ] :
# lUserRights = inGSettings["Server"]["AccessUsers"]["RuleDomainUserDict"][(inRequest.OpenRPA["Domain"].upper(), inRequest.OpenRPA["User"].upper())]
lUACBool = False # UAC Check is not passed - False for user
# if len(lUserRights["ControlPanelKeyAllowedList"]) > 0 and lItem["KeyStr"] not in lUserRights["ControlPanelKeyAllowedList"]:
# lUACBool = False # UAC Check is not passed - False for user
if lUACBool : # Run function if UAC is TRUE
if lUACBool : # Run function if UAC is TRUE
# Выполнить вызов и записать результат
# Выполнить вызов и записать результат
# Call def (inRequest, inGSettings) or def (inGSettings)
# Call def (inRequest, inGSettings) or def (inGSettings)
@ -57,9 +60,13 @@ def HiddenCPDictGenerate(inRequest, inGSettings):
# Return {"Key":{"",""}}
# Return {"Key":{"",""}}
def HiddenRDPDictGenerate ( inRequest , inGSettings ) :
def HiddenRDPDictGenerate ( inRequest , inGSettings ) :
dUAC = inRequest . UACClientCheck # Alias.
lUACRDPTemplateKeyList = [ " pyOpenRPADict " , " RDPKeyDict " ]
lRDPDict = { " HandlebarsList " : [ ] }
lRDPDict = { " HandlebarsList " : [ ] }
# Iterate throught the RDP list
# Iterate throught the RDP list
for lRDPSessionKeyStrItem in inGSettings [ " RobotRDPActive " ] [ " RDPList " ] :
for lRDPSessionKeyStrItem in inGSettings [ " RobotRDPActive " ] [ " RDPList " ] :
# Check UAC
if dUAC ( inRoleKeyList = lUACRDPTemplateKeyList + [ lRDPSessionKeyStrItem ] ) :
lRDPConfiguration = inGSettings [ " RobotRDPActive " ] [ " RDPList " ] [
lRDPConfiguration = inGSettings [ " RobotRDPActive " ] [ " RDPList " ] [
lRDPSessionKeyStrItem ] # Get the configuration dict
lRDPSessionKeyStrItem ] # Get the configuration dict
lDataItemDict = { " SessionKeyStr " : " " , " SessionHexStr " : " " , " IsFullScreenBool " : False ,
lDataItemDict = { " SessionKeyStr " : " " , " SessionHexStr " : " " , " IsFullScreenBool " : False ,
@ -77,10 +84,14 @@ def HiddenRDPDictGenerate(inRequest, inGSettings):
# Return {"HostNameUpperStr;UserUpperStr":{"IsListenBool":True}, "HandlebarsList":[{"HostnameUpperStr":"","UserUpperStr":"","IsListenBool":True}]}
# Return {"HostNameUpperStr;UserUpperStr":{"IsListenBool":True}, "HandlebarsList":[{"HostnameUpperStr":"","UserUpperStr":"","IsListenBool":True}]}
def HiddenAgentDictGenerate ( inRequest , inGSettings ) :
def HiddenAgentDictGenerate ( inRequest , inGSettings ) :
dUAC = inRequest . UACClientCheck # Alias.
lUACAgentTemplateKeyList = [ " pyOpenRPADict " , " AgentKeyDict " ]
lAgentDict = { " HandlebarsList " : [ ] }
lAgentDict = { " HandlebarsList " : [ ] }
# Iterate throught the RDP list
# Iterate throught the RDP list
for lAgentItemKeyStrItem in inGSettings [ " AgentDict " ] :
for lAgentItemKeyStrItem in inGSettings [ " AgentDict " ] :
# Check UAC
lKeyStr = f " { lAgentItemKeyStrItem [ 0 ] } ; { lAgentItemKeyStrItem [ 1 ] } " # turple ("HostNameUpperStr","UserUpperStr") > Str "HostNameUpperStr;UserUpperStr"
lKeyStr = f " { lAgentItemKeyStrItem [ 0 ] } ; { lAgentItemKeyStrItem [ 1 ] } " # turple ("HostNameUpperStr","UserUpperStr") > Str "HostNameUpperStr;UserUpperStr"
if dUAC ( inRoleKeyList = lUACAgentTemplateKeyList + [ lKeyStr ] ) :
lDataItemDict = inGSettings [ " AgentDict " ] [ lAgentItemKeyStrItem ]
lDataItemDict = inGSettings [ " AgentDict " ] [ lAgentItemKeyStrItem ]
lAgentDict [ lKeyStr ] = lDataItemDict
lAgentDict [ lKeyStr ] = lDataItemDict
lHandlebarsDataItemDict = copy . deepcopy ( lDataItemDict )
lHandlebarsDataItemDict = copy . deepcopy ( lDataItemDict )