Skip to content

Commit

Permalink
Merge pull request #842 from EvanBldy/master
Browse files Browse the repository at this point in the history
various improvements
  • Loading branch information
EvanBldy authored Aug 21, 2024
2 parents 0449c85 + 90f35d5 commit b64e939
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 7 additions & 1 deletion zou/app/blueprints/crud/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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):
Expand Down
11 changes: 7 additions & 4 deletions zou/app/blueprints/shots/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand All @@ -88,7 +91,7 @@ def put(self, shot_id):
"entities_out",
"type",
"shotgun_id",
"created_by"
"created_by",
]:
data.pop(field, None)

Expand Down

0 comments on commit b64e939

Please sign in to comment.