mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-29 20:43:10 +02:00
Merge branch 'main' into za/3528-add-member-error-handling
This commit is contained in:
commit
b694a7811b
28 changed files with 626 additions and 119 deletions
|
@ -16,7 +16,7 @@ class UserPortfolioRoleChoices(models.TextChoices):
|
|||
"""
|
||||
|
||||
ORGANIZATION_ADMIN = "organization_admin", "Admin"
|
||||
ORGANIZATION_MEMBER = "organization_member", "Member"
|
||||
ORGANIZATION_MEMBER = "organization_member", "Basic"
|
||||
|
||||
@classmethod
|
||||
def get_user_portfolio_role_label(cls, user_portfolio_role):
|
||||
|
@ -30,17 +30,17 @@ class UserPortfolioRoleChoices(models.TextChoices):
|
|||
class UserPortfolioPermissionChoices(models.TextChoices):
|
||||
""" """
|
||||
|
||||
VIEW_ALL_DOMAINS = "view_all_domains", "View all domains and domain reports"
|
||||
VIEW_MANAGED_DOMAINS = "view_managed_domains", "View managed domains"
|
||||
VIEW_ALL_DOMAINS = "view_all_domains", "Viewer"
|
||||
VIEW_MANAGED_DOMAINS = "view_managed_domains", "Viewer, limited (domains they manage)"
|
||||
|
||||
VIEW_MEMBERS = "view_members", "View members"
|
||||
EDIT_MEMBERS = "edit_members", "Create and edit members"
|
||||
VIEW_MEMBERS = "view_members", "Viewer"
|
||||
EDIT_MEMBERS = "edit_members", "Manager"
|
||||
|
||||
VIEW_ALL_REQUESTS = "view_all_requests", "View all requests"
|
||||
EDIT_REQUESTS = "edit_requests", "Create and edit requests"
|
||||
VIEW_ALL_REQUESTS = "view_all_requests", "Viewer"
|
||||
EDIT_REQUESTS = "edit_requests", "Creator"
|
||||
|
||||
VIEW_PORTFOLIO = "view_portfolio", "View organization"
|
||||
EDIT_PORTFOLIO = "edit_portfolio", "Edit organization"
|
||||
VIEW_PORTFOLIO = "view_portfolio", "Viewer"
|
||||
EDIT_PORTFOLIO = "edit_portfolio", "Manager"
|
||||
|
||||
@classmethod
|
||||
def get_user_portfolio_permission_label(cls, user_portfolio_permission):
|
||||
|
@ -79,6 +79,13 @@ class MemberPermissionDisplay(StrEnum):
|
|||
NONE = "None"
|
||||
|
||||
|
||||
def get_readable_roles(roles):
|
||||
readable_roles = []
|
||||
if roles:
|
||||
readable_roles = sorted([UserPortfolioRoleChoices.get_user_portfolio_role_label(role) for role in roles])
|
||||
return readable_roles
|
||||
|
||||
|
||||
def get_role_display(roles):
|
||||
"""
|
||||
Returns a user-friendly display name for a given list of user roles.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue