-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Endpoint providing information what actions a user has access to #205
Comments
I believe that The action write includes both saving data and submitting a data step right? |
Agree. The above list was not intended to be complete, only to indicate what we need related to signing. Those should definitely be on the list. |
Added a proposal to how we can change the process definition (bpmn) file to support the new "actions" and adhere more to the bpmn standard with the use of extensionElements in the definition. |
#207 (#237) * New process engine seems to work. Needs more tests and verification * refactored to make class more testable * added tests for ProcessEngine * Refactor and delete old and unused code * added tests for ProcessEventDispatcher * Add tests and fix ProcessNavigator * add available actions to currentTask and perform authcheck * action passed along from PUT process/next to gateway filters * fix bug in AppProcessState ctor * add fields for read/write and check users permissions * Fix test stub implementation of IProcessExclusiveGateway * Fixing some reported code smells * Some code smell fixes. Added logic to dispatch abandon event if action is reject * remove unfinished test file * add tests for method in ProcessClient * add test for classes extending storage classes * add test for null values in extensions * revert code changes due to test * add frontend feature and parse request body on process/next if present * add frontend feature and parse request body on process/next if present * fix codeql warning * add v8 as target of github workflows in addition to main * Fix return type of all methods in ProcessController returning ProcessState * Authorize action moved to AuthorizationClient TaskType is substituted with corresponding action earlier Resolvs #207 * Fixed some issues after review and added some more tests * fix codeQL warning and improve test * Fix some code smells * Update src/Altinn.App.Api/Controllers/InstancesController.cs Co-authored-by: Ronny Birkeli <ronny.birkeli@gmail.com> * fix build error --------- Co-authored-by: Ronny Birkeli <ronny.birkeli@gmail.com>
Description
The app backend needs to provide an endpoint providing information about the requesting users access rights on the current step.
This should cover:
confirm
andinstantiate
are not for this issue, but is included to show that we need to support multiple actions related to a step in the process and that we can control access to these actions.The same endpoint should also list the roles that actually has access to the current step and actions.
Additional Information
Related epic: Altinn/app-template-dotnet#170
Related frontend issue: Altinn/app-frontend-react#991
Tasks
No response
Proposed change in process file and process engine
Given this fairly simple, and not uncommon flow:
Implicit actions that happen when an instance leave a Data task is:
Moving "back" in the process we need to delete the existing PDF to ensure it has no outdated data and unlock the data to make changes possible.
To handle the unlock and delete actions we need some way of knowing if the process is moving forwards or backwards
Today
Todays solution of informing the process engine if the process is moving forward or backwards is done by adding custom attributes to the flows out of the gateway. Example BPMN describing the image above (note the altinn:flowtype on SequenceFlow 4 and 5):
To make present the user with the available choices, lets call them "actions", that is possible from this task the process engine needs to do a simulated play of the process and present the user with all the tasks that could be reached by flows from the current task, gateways are evaluated and if not decision can be made all flows are followed and resulting tasks presented as possible "actions" for the user.
In the example above, if the process is in Task2 the user would be presented with a list of possible actions: [Task1, End].
If the user chooses to take the "action" Task1 the process engine would follow the flows from Task2 to Task1 and discover that SequenceFlow_5 has flowtype AbandonCurrentReturnToNext and execute logic connected to this flowtype.
In my opinion this is a flawed, if not wrong, when the process is on a given task I think this Task should contain enough information to present the user with what "actions" are possible to do without reading the rest of the process definition.
Proposal
TL;DR;
Frontend would then get the possible actions from the instance current position(task) in the process. No need to follow flows or evaluating gateways before the user actually takes a action.
Frontend still receives the altinn:tasktype but it is derived from the extension properties instead
Unlocking the data and deleting outdated PDFs would then be performed before the process leaves Task2 in the example process.
Example process definition:
API response proposed by frontend
PUT */process/next
(response)GET */process
(response)Even more verbose process definition OUT OF SCOPE
One could argue that we are implicit doing some actions that are hidden for the developer today.
If we go fullblown BPMN one could introduce UserTasks and ServiceTasks and make every implicit action we do defined in the process. This is not in scope for this issue, but should be considered for future work
Example image of the process described abov:
Acceptance Criterias
The text was updated successfully, but these errors were encountered: