Record become/stop root user events

This commit is contained in:
Lance Edgar 2017-08-05 16:11:56 -05:00
parent 54a364aa0c
commit 941ce1a9cb

View file

@ -181,6 +181,7 @@ class AuthenticationView(View):
"""
if not self.request.is_admin:
raise HTTPForbidden()
self.request.user.record_event(self.enum.USER_EVENT_BECOME_ROOT)
self.request.session['is_root'] = True
self.request.session.flash("You have been elevated to 'root' and now have full system access")
return self.redirect(self.request.get_referrer())
@ -191,6 +192,7 @@ class AuthenticationView(View):
"""
if not self.request.is_admin:
raise HTTPForbidden()
self.request.user.record_event(self.enum.USER_EVENT_STOP_ROOT)
self.request.session['is_root'] = False
self.request.session.flash("Your normal system access has been restored")
return self.redirect(self.request.get_referrer())