10-17-2022 04:25 PM - last edited on 05-03-2023 09:29 AM by JackLacava
Hello All,
I have 2 questions regarding interaction between workflow standard functionality and user's rights.
When we use form templates, by default users can complete/revert form or the complete/revert Forms workflow. My client would like to adapt this behaviour so that user can complete their form/workflow but revert can only be done by admins, hence those buttons should remain greyed out/inactive for end user : is it possible ?
Also, when we complete a form or even lock centrally a whole workflow, that prevent any data input but still allow users to run calculations through buttons (which trigger data management jobs) that are present in the dashboard. Can we lock somehow the fact for end users to be able to run, or not, those calculations?
Thanks for your help
Matthieu
10-18-2022 05:24 AM - edited 10-18-2022 05:27 AM
Think you'll need set up the FormsEventHandler Extensbility Rule to prevent users from reverting a form if they are not an Administrator.
Try this:
Select Case args.OperationName
Case Is = BREventOperationType.Forms.RevertForm
If (BRApi.Security.Authorization.IsUserInGroup(si, "Administrators")) Then
'Do nothing
Else
If (args.IsBeforeEvent = False) Then
Throw (New XFUserMsgException(si, Nothing, Nothing, "Only Administrators can Revert Form"))
End If
End If
End Select
10-18-2022 06:11 AM
Calculations triggered by DataManagement jobs are likely using Custom Calculation functions, so in those functions you could check the status of the workflow before you perform the action. You might have to pass the workflow coordinates (profile, scenario, period) to the functions as parameters.
Also consider that there is a Manage Data Group property on the Scenario, and anyone not in that group won't be able to run DM jobs targeting that Scenario. Obviously it's not a solution if users do need to run those calculations at some point, but it's an option if the functionality can be removed from them altogether.