From b84b8cb6e98eea2ab2f6352ec34959b84b908140 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 31 Mar 2018 14:01:39 +0530 Subject: [PATCH] only canEditEvents/canEditPlaces can add new places/events --- pandora/event/views.py | 11 ++++++----- pandora/place/views.py | 10 +++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/pandora/event/views.py b/pandora/event/views.py index 19cf0fd3..adf9e758 100644 --- a/pandora/event/views.py +++ b/pandora/event/views.py @@ -8,16 +8,17 @@ from django.conf import settings from six import string_types import ox from ox.utils import json + +from changelog.models import add_changelog +from item import utils +from oxdjango.api import actions from oxdjango.decorators import login_required_json from oxdjango.shortcuts import render_to_json_response, get_object_or_404_json, json_response - -from oxdjango.api import actions -from item import utils -from changelog.models import add_changelog +from user.decorators import capability_required_json from . import models -@login_required_json +@capability_required_json('canEditEvents') def addEvent(request, data): ''' Adds a new event to the calendar diff --git a/pandora/place/views.py b/pandora/place/views.py index c87e6c68..43ec4829 100644 --- a/pandora/place/views.py +++ b/pandora/place/views.py @@ -9,16 +9,16 @@ from six import string_types import ox from ox.utils import json +from changelog.models import add_changelog +from item import utils +from oxdjango.api import actions from oxdjango.decorators import login_required_json from oxdjango.shortcuts import render_to_json_response, get_object_or_404_json, json_response - -from oxdjango.api import actions -from item import utils -from changelog.models import add_changelog +from user.decorators import capability_required_json from . import models -@login_required_json +@capability_required_json('canEditPlaces') def addPlace(request, data): ''' Adds a new place to the map