Joseph Nuthalapati 377010b078
openvpn: Deny access to users not in group "vpn"
A new function called `user_group_view` has been added to
restrict access to only users in the groups "vpn" and "admin".

Some changes are made in AdminRequiredMiddleware to handle this.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-11-25 13:15:22 -05:00

19 lines
491 B
Python

# SPDX-License-Identifier: AGPL-3.0-or-later
"""
URLs for the OpenVPN module.
"""
from django.conf.urls import url
from plinth.utils import user_group_view
from . import views
urlpatterns = [
url(r'^apps/openvpn/$', views.OpenVPNAppView.as_view(), name='index'),
url(r'^apps/openvpn/setup/$', views.setup, name='setup'),
url(r'^apps/openvpn/ecc/$', views.ecc, name='ecc'),
url(r'^apps/openvpn/profile/$', user_group_view(views.profile, 'vpn'),
name='profile'),
]