Skip to content

Commit

Permalink
Add permissions field on ImageSerializer
Browse files Browse the repository at this point in the history
  • Loading branch information
tizot committed Feb 2, 2016
1 parent 0772f08 commit dc2c960
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sigma_files/serializers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from rest_framework import serializers
from dry_rest_permissions.generics import DRYPermissionsField

from sigma.utils import CurrentUserCreateOnlyDefault
from sigma_files.models import Image
Expand All @@ -12,3 +13,4 @@ class Meta:
height = serializers.IntegerField(source='file.height', read_only=True)
width = serializers.IntegerField(source='file.width', read_only=True)
owner = serializers.PrimaryKeyRelatedField(read_only=True, default=CurrentUserCreateOnlyDefault())
permissions = DRYPermissionsField(actions=['read', 'write'])

0 comments on commit dc2c960

Please sign in to comment.