diff --git a/setup.cfg b/setup.cfg index 7988ecf57a..6ca623ff20 100644 --- a/setup.cfg +++ b/setup.cfg @@ -55,7 +55,7 @@ install_requires = Jinja2==3.1.4 ldap3==2.9.1 matterhook==0.2 - meilisearch==0.31.4 + meilisearch==0.31.5 numpy==1.24.4; python_version == '3.8' numpy==2.0.1; python_version == '3.9' numpy==2.1.0; python_version >= '3.10' diff --git a/zou/app/blueprints/crud/entity.py b/zou/app/blueprints/crud/entity.py index 464633d537..0a75726555 100644 --- a/zou/app/blueprints/crud/entity.py +++ b/zou/app/blueprints/crud/entity.py @@ -13,6 +13,7 @@ ) from zou.app.models.project import Project from zou.app.models.subscription import Subscription +from zou.app.models.task import Task from zou.app.services import ( assets_service, breakdown_service, @@ -58,13 +59,18 @@ def emit_create_event(self, entity_dict): self.emit_event("new", entity_dict) def check_read_permissions(self): - return not permissions.has_vendor_permissions() + return True def add_project_permission_filter(self, query): if not permissions.has_admin_permissions(): query = query.join(Project).filter( user_service.build_related_projects_filter() ) + if permissions.has_vendor_permissions(): + query = query.join(Task).filter( + user_service.build_assignee_filter() + ) + return query def update_data(self, data): diff --git a/zou/app/blueprints/shots/resources.py b/zou/app/blueprints/shots/resources.py index e55ee4c236..3f617277b6 100644 --- a/zou/app/blueprints/shots/resources.py +++ b/zou/app/blueprints/shots/resources.py @@ -18,7 +18,10 @@ from zou.app.mixin import ArgsMixin from zou.app.utils import fields, query, permissions -from zou.app.services.exception import WrongParameterException +from zou.app.services.exception import ( + WrongParameterException, + ArgumentsException, +) class ShotResource(Resource, ArgsMixin): @@ -62,10 +65,10 @@ def put(self, shot_id): type: string format: UUID x-example: a24a6ea4-ce75-4665-a070-57453082c25 - - in: body + - in: body name: data required: True - type: object + type: object responses: 200: description: Update given shot @@ -88,7 +91,7 @@ def put(self, shot_id): "entities_out", "type", "shotgun_id", - "created_by" + "created_by", ]: data.pop(field, None)