Merge pull request #264 from dod-ccpo/view-pe-as-workspace-user

View projects and environments as a workspace user
This commit is contained in:
richard-dds
2018-09-11 10:16:18 -04:00
committed by GitHub
13 changed files with 220 additions and 11 deletions

View File

@@ -22,7 +22,8 @@ class Workspace(Base, TimestampsMixin):
def _is_workspace_owner(workspace_role):
return workspace_role.role.name == "owner"
return first_or_none(_is_workspace_owner, self.roles)
owner = first_or_none(_is_workspace_owner, self.roles)
return owner.user if owner else None
@property
def users(self):