Prevent anonymous users from accessing any setup page

Anonymous users were able to access pages that used
the 'public' decorator of stronghold. If such a page
showed the installation routine of the setup module
they were able to access and use it, in other words:
Anonymous users were able to install software.
This commit is contained in:
fonfon authored and James Valleroy committed 2016-12-28 19:35:04 -05:00
1 parent 8450b1e4c9
commit da91981ff5
1 file changed
+3 -1
+3 -1
View File
@@ -21,6 +21,7 @@ Django middleware to show pre-setup message and setup progress.
from django import urls
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext_lazy as _
import logging
@@ -75,5 +76,6 @@ class SetupMiddleware(object):
if module.setup_helper.get_state() == 'up-to-date':
return
view = views.SetupView.as_view()
# Only allow logged-in users to access any setup page
view = login_required(views.SetupView.as_view())
return view(request, setup_helper=module.setup_helper)