From: Michael Tremer Date: Thu, 16 Mar 2017 11:13:24 +0000 (+0000) Subject: talk: Make diagnosis page available for admins only X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=78439bec81183195af35a1cc11249f54b385d7a7;p=ipfire.org.git talk: Make diagnosis page available for admins only Signed-off-by: Michael Tremer --- diff --git a/templates/modules/menu.html b/templates/modules/menu.html index deba5339..35735cf9 100644 --- a/templates/modules/menu.html +++ b/templates/modules/menu.html @@ -62,9 +62,11 @@ -
  • - {{ _("Diagnosis") }} -
  • + {% if current_user.is_admin() %} +
  • + {{ _("Diagnosis") }} +
  • + {% end %} {% end %} diff --git a/templates/talk/diagnosis.html b/templates/talk/diagnosis.html index 2a5486d3..dc7ea86e 100644 --- a/templates/talk/diagnosis.html +++ b/templates/talk/diagnosis.html @@ -7,29 +7,7 @@

    {{ _("Diagnosis") }}

    -
    -

    {{ _("Test Call") }}

    + {% module TalkOngoingCalls() %} - -
    - - {% if current_user.is_admin() %} - {% module TalkOngoingCalls() %} - -
    - {% module TalkLines(show_account=True) %} -
    - {% end %} + {% module TalkLines(show_account=True) %} {% end block %} diff --git a/webapp/handlers_talk.py b/webapp/handlers_talk.py index ece823b0..89486bdf 100644 --- a/webapp/handlers_talk.py +++ b/webapp/handlers_talk.py @@ -35,6 +35,10 @@ class TalkPhonebookAccountHandler(BaseHandler): class TalkDiagnosisHandler(BaseHandler): @tornado.web.authenticated def get(self): + # Access only allowed for admins + if not self.current_user.is_admin(): + raise tornado.web.HTTPError(403) + return self.render("talk/diagnosis.html")