File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ def new_cred(request):
3838 return render (request , "dojo/new_cred.html" , {"tform" : tform })
3939
4040
41- @user_is_authorized (Product , Permissions .Product_View , "pid" )
41+ @user_is_authorized (Product , Permissions .Product_Edit , "pid" )
4242def all_cred_product (request , pid ):
4343 prod = get_object_or_404 (Product , id = pid )
4444 creds = Cred_Mapping .objects .filter (product = prod ).order_by ("cred_id__name" )
Original file line number Diff line number Diff line change 66from django .conf import settings
77from django .contrib import messages
88from django .contrib .admin .utils import NestedObjects
9+ from django .core .exceptions import PermissionDenied
910from django .db import DEFAULT_DB_ALIAS
1011from django .db .models import Count , Q , QuerySet
1112from django .http import HttpResponseRedirect
@@ -178,7 +179,7 @@ def view_endpoint_host(request, eid):
178179 return process_endpoint_view (request , eid , host_view = True )
179180
180181
181- @user_is_authorized (Endpoint , Permissions .Endpoint_View , "eid" )
182+ @user_is_authorized (Endpoint , Permissions .Endpoint_Edit , "eid" )
182183def edit_endpoint (request , eid ):
183184 endpoint = get_object_or_404 (Endpoint , id = eid )
184185
@@ -468,6 +469,9 @@ def prefetch_for_endpoints(endpoints):
468469
469470def migrate_endpoints_view (request ):
470471
472+ if not request .user .is_superuser :
473+ raise PermissionDenied
474+
471475 view_name = "Migrate endpoints"
472476
473477 html_log = clean_hosts_run (apps = apps , change = (request .method == "POST" ))
You can’t perform that action at this time.
0 commit comments