Skip to content

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

Open
@PhMemmel

Description

@PhMemmel

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions