Skip to content
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

feat: Add user dependent availability to actions for interactive steps #143

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

PhMemmel
Copy link
Contributor

@PhMemmel PhMemmel commented Feb 20, 2022

Closes #142

Implementation details:

  • I decided to add a method get_available_actions_for_user(array $actionstrings, int $userid, int $courseid) to interactionlibbase in which the subplugin developer can just filter the given $actionstrings to his needs.
  • If no actions are available to a user, but a course of this user has been triggered, there is a message shown that he/she cannot execute actions for this course, but has to wait for someone else to do this. I decided against hiding the course completely in this case due to the usability problem of manuals triggers: A user could trigger a workflow including a step in which he/she cannot execute any actions manually. This would lead to successful trigger but the user wouldn't see a course in the interaction attention table which IMHO is definitely worse than seeing he/she has to wait for another user to take care of this course.
  • By default the method just returns the complete array, so if the subplugin doesn't implement this method everything just behaves like before (full backwards compatibility)
  • There is a minor problem with this feature in general: The developer has to take care that at least one user has access to at least one action (or there is a timeout on the interaction), otherwise the process of a course could be stuck. However I would consider this as a coding issue of the subplugin developer which cannot easily be avoided from the side of the main plugin. Due to the fact that it's easier to make this error than before (by not adding any actions at all for example), I added a warning to the php doc about it.

If you have any feedback on this, let me know. Thanks in advance.

@PhMemmel PhMemmel force-pushed the feat-add_user_dependent_availability_to_actions branch from fb3b3fe to 3660bb9 Compare February 20, 2022 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Make interactive steps only accessible to specific user
1 participant