Skip to content
Snippets Groups Projects
Commit 63b1e118 authored by LouisGendron's avatar LouisGendron
Browse files

Merge branch...

Merge branch '178-dataset-and-datafile-graphql-queries-should-incidate-if-the-user-is-the-owner-of-the-object' into 'master'

Resolve "Dataset and datafile graphql queries should incidate if the user is the owner of the object"

Closes #178

See merge request !101
parents b0d5f4e1 4ede1383
No related branches found
No related tags found
1 merge request!101Resolve "Dataset and datafile graphql queries should incidate if the user is the owner of the object"
...@@ -26,12 +26,22 @@ class DataFileType(DjangoObjectType): ...@@ -26,12 +26,22 @@ class DataFileType(DjangoObjectType):
model = DataFile model = DataFile
fields = "__all__" fields = "__all__"
owned_by_user = graphene.Boolean()
def resolve_owned_by_user(self, info):
return self.uploaded_by == info.context.user.profile
class DataSetType(DjangoObjectType): class DataSetType(DjangoObjectType):
class Meta: class Meta:
model = DataSet model = DataSet
fields = "__all__" fields = "__all__"
owned_by_user = graphene.Boolean()
def resolve_owned_by_user(self, info):
return self.created_by == info.context.user.profile
class ProfileType(DjangoObjectType): class ProfileType(DjangoObjectType):
class Meta: class Meta:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment