refactor authentication / authorization into a mixin

This commit is contained in:
Jakob Ketterl
2021-02-10 20:21:45 +01:00
parent 8422a33081
commit 17c20d12e0
3 changed files with 9 additions and 8 deletions

View File

@@ -1,9 +1,10 @@
from owrx.controllers.admin import AdminController
from owrx.controllers.template import WebpageController
from owrx.controllers.admin import AuthorizationMixin
from owrx.users import UserList, DefaultPasswordClass
from urllib.parse import parse_qs
class ProfileController(AdminController):
class ProfileController(AuthorizationMixin, WebpageController):
def isAuthorized(self):
return self.user is not None and self.user.is_enabled() and self.user.must_change_password