From a63cae5fd77f652df4cd06be92c8d817992e9df5 Mon Sep 17 00:00:00 2001 From: Julian Palmerio Date: Thu, 21 Dec 2023 15:31:19 -0300 Subject: [PATCH] feat: Course roles perm_name property in permissions enum (#33970) * feat: add perm_name property to permissions enum --- openedx/core/djangoapps/course_roles/data.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openedx/core/djangoapps/course_roles/data.py b/openedx/core/djangoapps/course_roles/data.py index afb51810b6c6..f566faa46efc 100644 --- a/openedx/core/djangoapps/course_roles/data.py +++ b/openedx/core/djangoapps/course_roles/data.py @@ -162,3 +162,11 @@ class CourseRolesPermission(Enum): _("Specific Masquerading"), _("Can view the course as an Audit, Verified, Beta Tester, Master's track, username/email."), ) + + @property + def perm_name(self): + """ + The permission name with the course_roles prefix. + Example: course_roles.manage_content + """ + return f'course_roles.{self.value.name}'