[Update] 用户Profile添加在当前组织的角色

This commit is contained in:
ibuler
2020-05-13 11:05:58 +08:00
parent 195cbbbe42
commit 17163dd909
2 changed files with 15 additions and 9 deletions

View File

@@ -159,6 +159,14 @@ class RoleMixin:
roles.append(str(_('User')))
return " | ".join(roles)
def current_org_roles(self):
roles = []
if self.can_admin_current_org:
roles.append('Admin')
if self.can_audit_current_org:
roles.append('Auditor')
return roles
@property
def is_superuser(self):
if self.role == 'Admin':