CheckSession: verify that the current session matches the permissions required for the current job
Tag: CheckSession
When an automation script uses functions that require certain privileges and rights, CheckSession allows to verify the credentials of the user session the script was launched from, and warn the user of potential access problems, or raise an error.
NB: this is only relevant in Job automation. Basic automation from XML files cannot be verified with CheckSession.
If Value is not supplied in the script, the values set in the job header are used.
Role privileges are always set in the script header, and are always verified with CheckSession.
<CheckSession Value="WarningIfAdmin" Type="ERROR"/>
Tag Attributes
Attributes | Attribute Value |
---|---|
Value | A semi-colon-separted combination of: RequiredLogin WarningIfAdmin WarningIfAdminTech WarningIfUltraAdminTech |
Type | If omitted or left blank (""), displays the warning message box, If set to "Error", triggers an automation error. |
Detailed Description
Upon analysis of the context (current session is active, admin, ultra admin), the job center opens a dialog to inform the user, who might cancel execution.
An RBAC session is considered an Ultra Admin.
RequiredLogin: A session must be active for the job to execute
WarningIfAdmin: Warns about possible missing permissions if you're logged in as an admin
WarningIfUltraAdminTech: An Admin session is recommended
WarningIfAdminTech: An Ultra Admin session is recommended
Example Script
<ytriaAutomation Application="sapio365">
<!-- logged in as admin: error -->
<CheckSession Value="WarningIfAdmin" Type="ERROR"/>
<ShowGroups/>
</ytriaAutomation>