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: Make interactive steps only accessible to specific user #142

Open
PhMemmel opened this issue Feb 17, 2022 · 0 comments · May be fixed by #143
Open

feat: Make interactive steps only accessible to specific user #142

PhMemmel opened this issue Feb 17, 2022 · 0 comments · May be fixed by #143

Comments

@PhMemmel
Copy link
Contributor

A use case that came up for us:

We need to trigger interactive steps, but we only want to show the steps to specific users/roles.

Implementation idea: Add a method is_available_to_user($currentuser, $course, ...) to the interactionlibbase class which returns true by default but can be overwritten by a step subplugin to avoid showing this step to the current user. This method has to be respected by the table view of the courses.
Another idea would be to implement a method generating an array of user ids which are allowed to interact with this step. Not 100% sure, what's the better approach.

I realize that this is somewhat similar to the get_relevant_capability method, but unfortunately, defining a capability is not enough for our use case.

I talked to some other devs about this and we came to the conclusion that this would be an easy yet effective approach. I'm going to implement this and will send a PR. If you have thoughts on the idea, the mentioned approach or the implementation details, let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant