Skip to content

Commit

Permalink
mf
Browse files Browse the repository at this point in the history
  • Loading branch information
mam10eks committed Dec 3, 2024
1 parent cb4cb3e commit 8767983
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/src/tira_app/endpoints/admin_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from django.conf import settings
from django.core.serializers.json import DjangoJSONEncoder
from django.http import JsonResponse
from django.http import HttpResponseNotAllowed, JsonResponse
from slugify import slugify

from .. import tira_model as model
Expand Down Expand Up @@ -577,6 +577,8 @@ def admin_edit_organizer(request, organizer_id):
@check_conditional_permissions(restricted=True)
def admin_create_group(request, vm_id):
"""this is a rest endpoint to grant a user permissions on a vm"""
if auth.get_role(request=request) != "admin":
return HttpResponseNotAllowed("Access forbidden.")

vm_id = slugify(vm_id)
model.model.create_model(vm_id)
Expand Down

0 comments on commit 8767983

Please sign in to comment.