Merge pull request #275 from dod-ccpo/fix-workspaces-query

Allow CCPO to view workspaces
This commit is contained in:
richard-dds
2018-09-12 11:37:33 -04:00
committed by GitHub
6 changed files with 46 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ from sqlalchemy.dialects.postgresql import UUID
from atst.models import Base
from .types import Id
from atst.models.permissions import Permissions
class User(Base):
@@ -28,3 +29,9 @@ class User(Base):
@property
def full_name(self):
return "{} {}".format(self.first_name, self.last_name)
@property
def has_workspaces(self):
return (
Permissions.VIEW_WORKSPACE in self.atat_role.permissions
) or self.workspace_roles