diff --git a/openedx_filters/learning/filters.py b/openedx_filters/learning/filters.py index 2e7e8764..348df9bd 100644 --- a/openedx_filters/learning/filters.py +++ b/openedx_filters/learning/filters.py @@ -662,3 +662,43 @@ def run_filter(cls, context, template_name): """ data = super().run_pipeline(context=context, template_name=template_name) return data.get("context"), data.get("template_name") + + +class AccessRoleCheckRequested(OpenEdxPublicFilter): + + filter_type = "org.openedx.learning.access.role.check.requested.v1" + + @classmethod + def run_filter(cls, user, roles, course_key): + data = super().run_pipeline(user=user, roles=roles, course_key=course_key) + return data.get("user"), data.get("roles"), data.get("course_key") + + +class AccessRoleAdditionRequested(OpenEdxPublicFilter): + + filter_type = "org.openedx.learning.access.role.addition.requested.v1" + + @classmethod + def run_filter(cls, user, roles, course_key): + data = super().run_pipeline(user=user, roles=roles, course_key=course_key) + return data.get("user"), data.get("roles"), data.get("course_key") + + +class AccessRoleRemovalRequested(OpenEdxPublicFilter): + + filter_type = "org.openedx.learning.access.role.removal.requested.v1" + + @classmethod + def run_filter(cls, user, roles, course_key): + data = super().run_pipeline(user=user, roles=roles, course_key=course_key) + return data.get("user"), data.get("roles"), data.get("course_key") + + +class UsersWithRolesRequested(OpenEdxPublicFilter): + + filter_type = "org.openedx.learning.access.role.users.retrieval.requested.v1" + + @classmethod + def run_filter(cls, user, roles, course_key): + data = super().run_pipeline(user=user, roles=roles, course_key=course_key) + return data.get("user"), data.get("roles"), data.get("course_key")