Record become/stop root user events
This commit is contained in:
parent
54a364aa0c
commit
941ce1a9cb
|
@ -181,6 +181,7 @@ class AuthenticationView(View):
|
||||||
"""
|
"""
|
||||||
if not self.request.is_admin:
|
if not self.request.is_admin:
|
||||||
raise HTTPForbidden()
|
raise HTTPForbidden()
|
||||||
|
self.request.user.record_event(self.enum.USER_EVENT_BECOME_ROOT)
|
||||||
self.request.session['is_root'] = True
|
self.request.session['is_root'] = True
|
||||||
self.request.session.flash("You have been elevated to 'root' and now have full system access")
|
self.request.session.flash("You have been elevated to 'root' and now have full system access")
|
||||||
return self.redirect(self.request.get_referrer())
|
return self.redirect(self.request.get_referrer())
|
||||||
|
@ -191,6 +192,7 @@ class AuthenticationView(View):
|
||||||
"""
|
"""
|
||||||
if not self.request.is_admin:
|
if not self.request.is_admin:
|
||||||
raise HTTPForbidden()
|
raise HTTPForbidden()
|
||||||
|
self.request.user.record_event(self.enum.USER_EVENT_STOP_ROOT)
|
||||||
self.request.session['is_root'] = False
|
self.request.session['is_root'] = False
|
||||||
self.request.session.flash("Your normal system access has been restored")
|
self.request.session.flash("Your normal system access has been restored")
|
||||||
return self.redirect(self.request.get_referrer())
|
return self.redirect(self.request.get_referrer())
|
||||||
|
|
Loading…
Reference in a new issue