Esempio n. 1
0
 def get(self, person_id):
     """
     Return task assigned to given user of which status has is_done flag sets to true.      
     ---
     tags:
     - Tasks
     description: It return only tasks related to open projects. 
     parameters:
       - in: path
         name: person_id
         required: True
         schema:
             type: UUID
             example: a24a6ea4-ce75-4665-a070-57453082c25
     responses:
         200:
             description: Tasks assigned to user that are done
     """
     if not permissions.has_admin_permissions():
         projects = user_service.related_projects()
     else:
         projects = projects_service.open_projects()
     if permissions.has_vendor_permissions():
         person = persons_service.get(person_id)
         if person["role"] == "vendor":
             return []
     elif permissions.has_client_permissions():
         return []
     return tasks_service.get_person_done_tasks(person_id, projects)
Esempio n. 2
0
 def get(self, person_id):
     if not permissions.has_admin_permissions():
         projects = user_service.related_projects()
     else:
         projects = projects_service.open_projects()
     if permissions.has_vendor_permissions():
         person = persons_service.get(person_id)
         if person["role"] == "vendor":
             return []
     return tasks_service.get_person_done_tasks(person_id, projects)