Continued Setup
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
def verify(roles, security_level):
|
||||
verification_result = False
|
||||
|
||||
authentication_dictionary = {
|
||||
"securityDeviceConfigHMI": ["Administrator", "Maintenance", "Operations Supervisor",],
|
||||
"securityConfigSecurity": ["Administrator", "Maintenance", "Operations Supervisor",],
|
||||
"securityDeviceConfigBehavior": ["Administrator", "Maintenance", "Operations Supervisor",],
|
||||
"securityDeviceConfigTimers": ["Administrator", "Maintenance", "Operations Supervisor", "Operator"],
|
||||
"securityDeviceConfigFailTimers": ["Administrator", "Maintenance", "Operations Supervisor", "Operator"],
|
||||
"securityBypassFeedback": ["Administrator", "Maintenance", "Operations Supervisor",],
|
||||
"securityBypassInterlocks": ["Administrator", "Maintenance", "Operations Supervisor",],
|
||||
"securityDeviceConfigLimits": ["Administrator", "Maintenance", "Operations Supervisor", "Operator"],
|
||||
"securityDeviceConfigThresholds": ["Administrator", "Maintenance", "Operations Supervisor", "Operator"],
|
||||
"securityEnableSimulation": ["Administrator", "Maintenance", ],
|
||||
"securityEnterOperSettings": ["Administrator", "Maintenance", "Operations Supervisor", "Operator"],
|
||||
"securityOperateEquipment": ["Administrator", "Maintenance", "Operations Supervisor", "Operator"],
|
||||
"securityOverrideInputs": ["Administrator", "Maintenance", "Operations Supervisor",],
|
||||
"securityAlarmConfig": ["Administrator", "Maintenance", "Operations Supervisor",],
|
||||
"securityAlarmDisable": ["Administrator", "Maintenance", "Operations Supervisor",],
|
||||
"securityAlarmShelve": ["Administrator", "Maintenance", "Operations Supervisor", "Operator"],
|
||||
"securityCmdSrcMaint": ["Administrator", "Maintenance", ],
|
||||
"securityCmdSrcOperProg": ["Administrator", "Maintenance", "Operations Supervisor", "Operator"],
|
||||
"securityCmdSrcOutOfService": ["Administrator", "Maintenance", "Operations Supervisor",],
|
||||
"securityDeviceConfigTuning": ["Administrator", "Maintenance", "Operations Supervisor",],
|
||||
"userHasBasic": ["Administrator", "Maintenance", "Operations Supervisor", "Operator"],
|
||||
"userHasAdvanced": ["Administrator", "Maintenance", "Operations Supervisor",],
|
||||
}
|
||||
|
||||
try:
|
||||
level_roles = authentication_dictionary[security_level]
|
||||
string = ""
|
||||
|
||||
for role in roles:
|
||||
if role in level_roles:
|
||||
verification_result = True
|
||||
|
||||
except:
|
||||
verification_result = False
|
||||
|
||||
return verification_result
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"scope": "A",
|
||||
"version": 1,
|
||||
"restricted": false,
|
||||
"overridable": true,
|
||||
"files": [
|
||||
"code.py"
|
||||
],
|
||||
"attributes": {
|
||||
"lastModificationSignature": "44718e8438f3d36d5d6463553d7d4dc03ff9d324d3b2c5a86952dc43f1284fe8",
|
||||
"lastModification": {
|
||||
"actor": "admin",
|
||||
"timestamp": "2025-11-05T22:39:10Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
# Encapsulation of system.perspective.openPopup
|
||||
# Use on button event script - Non-Resizable popup with close Icon.
|
||||
# This allows for feeding the path of the view and the params for the view.
|
||||
|
||||
def popupBtn(path, popUpParams, popUpTitle, showClose, resize):
|
||||
import random
|
||||
# Generate Page ID (random from 1 to 100)
|
||||
pgID = str(random.randint(1,100))
|
||||
popUpParams = dict(popUpParams)
|
||||
system.perspective.openPopup(pgID, path, params = popUpParams, title = popUpTitle, showCloseIcon = showClose, resizable = resize)
|
||||
|
||||
def hoverLblOpn(path, popUpParams, popUpTitle, showClose, resize, lblPos):
|
||||
pgID = "hoverLbl"
|
||||
popUpParams = dict(popUpParams)
|
||||
system.perspective.openPopup(pgID, path, params = popUpParams, title = popUpTitle, showCloseIcon = showClose, resizable = resize, position = lblPos)
|
||||
|
||||
def hoverLblCls():
|
||||
system.perspective.closePopup("hoverLbl")
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"scope": "A",
|
||||
"version": 1,
|
||||
"restricted": false,
|
||||
"overridable": true,
|
||||
"files": [
|
||||
"code.py"
|
||||
],
|
||||
"attributes": {
|
||||
"lastModificationSignature": "b98496172f63149edff6bbf832da1967f01be0a33c2fe4b7b57b2d004c4b2717",
|
||||
"lastModification": {
|
||||
"actor": "admin",
|
||||
"timestamp": "2025-11-05T22:39:10Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user