only canEditEvents/canEditPlaces can add new places/events
This commit is contained in:
parent
7b2acb3bc1
commit
b84b8cb6e9
2 changed files with 11 additions and 10 deletions
|
@ -8,16 +8,17 @@ from django.conf import settings
|
||||||
from six import string_types
|
from six import string_types
|
||||||
import ox
|
import ox
|
||||||
from ox.utils import json
|
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.decorators import login_required_json
|
||||||
from oxdjango.shortcuts import render_to_json_response, get_object_or_404_json, json_response
|
from oxdjango.shortcuts import render_to_json_response, get_object_or_404_json, json_response
|
||||||
|
from user.decorators import capability_required_json
|
||||||
from oxdjango.api import actions
|
|
||||||
from item import utils
|
|
||||||
from changelog.models import add_changelog
|
|
||||||
|
|
||||||
from . import models
|
from . import models
|
||||||
|
|
||||||
@login_required_json
|
@capability_required_json('canEditEvents')
|
||||||
def addEvent(request, data):
|
def addEvent(request, data):
|
||||||
'''
|
'''
|
||||||
Adds a new event to the calendar
|
Adds a new event to the calendar
|
||||||
|
|
|
@ -9,16 +9,16 @@ from six import string_types
|
||||||
import ox
|
import ox
|
||||||
from ox.utils import json
|
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.decorators import login_required_json
|
||||||
from oxdjango.shortcuts import render_to_json_response, get_object_or_404_json, json_response
|
from oxdjango.shortcuts import render_to_json_response, get_object_or_404_json, json_response
|
||||||
|
from user.decorators import capability_required_json
|
||||||
from oxdjango.api import actions
|
|
||||||
from item import utils
|
|
||||||
from changelog.models import add_changelog
|
|
||||||
|
|
||||||
from . import models
|
from . import models
|
||||||
|
|
||||||
@login_required_json
|
@capability_required_json('canEditPlaces')
|
||||||
def addPlace(request, data):
|
def addPlace(request, data):
|
||||||
'''
|
'''
|
||||||
Adds a new place to the map
|
Adds a new place to the map
|
||||||
|
|
Loading…
Reference in a new issue