Skip to content

Commit

Permalink
feat: Course roles perm_name property in permissions enum (#33970)
Browse files Browse the repository at this point in the history
* feat: add perm_name property to permissions enum
  • Loading branch information
julianpalmerio authored and hsinkoff committed Jan 2, 2024
1 parent 46f9c27 commit a63cae5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions openedx/core/djangoapps/course_roles/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'

0 comments on commit a63cae5

Please sign in to comment.