@computed_property
def system_wide_role(self):
    'For choosing the role string to show to the user; of all the roles in\n    the system-wide context, it shows the highest ranked one (if there are\n    multiple) or "No Access" if there are none.\n    '
    if (self.email in getattr(settings, 'BOOTSTRAP_ADMIN_USERS', [])):
        return u'Superuser'
    ROLE_HIERARCHY = {u'gGRC Admin': 0, u'Editor': 1, u'Reader': 2, u'Creator': 3}
    system_wide_roles = ROLE_HIERARCHY.keys()
    unique_roles = set([user_role.role.name for user_role in self.user_roles if (user_role.role.name in system_wide_roles)])
    if (len(unique_roles) == 0):
        return u'No Access'
    else:
        sorted_roles = sorted(unique_roles, key=(lambda x: ROLE_HIERARCHY.get(x, (- 1))))
        return sorted_roles[0]
For choosing the role string to show to the user; of all the roles in
the system-wide context, it shows the highest ranked one (if there are
multiple) or "No Access" if there are none.
@computed_property
def system_wide_role(self):
    'For choosing the role string to show to the user; of all the roles in\n    the system-wide context, it shows the highest ranked one (if there are\n    multiple) or "No Access" if there are none.\n    '
    if (self.email in getattr(settings, 'BOOTSTRAP_ADMIN_USERS', [])):
        return u'Superuser'
    ROLE_HIERARCHY = {u'gGRC Admin': 0, u'Editor': 1, u'Reader': 2, u'Creator': 3}
    system_wide_roles = ROLE_HIERARCHY.keys()
    unique_roles = set([user_role.role.name for user_role in self.user_roles if (user_role.role.name in system_wide_roles)])
    if (len(unique_roles) == 0):
        return u'No Access'
    else:
        sorted_roles = sorted(unique_roles, key=(lambda x: ROLE_HIERARCHY.get(x, (- 1))))
        return sorted_roles[0]