diff --git a/invenio_theme_tugraz/ext.py b/invenio_theme_tugraz/ext.py index 74b1296..3485ca1 100644 --- a/invenio_theme_tugraz/ext.py +++ b/invenio_theme_tugraz/ext.py @@ -8,6 +8,8 @@ """invenio module for TUGRAZ theme.""" +from invenio_records_marc21.ui.theme import current_identity_can_view + from . import config from .views import index, locked @@ -29,6 +31,10 @@ class InvenioThemeTugraz(object): app.register_error_handler(423, locked) + @app.context_processor + def inject_visibility(): + return {"can_view_marc21": current_identity_can_view()} + app.extensions["invenio-theme-tugraz"] = self def init_config(self, app): diff --git a/invenio_theme_tugraz/templates/invenio_theme_tugraz/overview.html b/invenio_theme_tugraz/templates/invenio_theme_tugraz/overview.html index 29675d4..02db9d4 100644 --- a/invenio_theme_tugraz/templates/invenio_theme_tugraz/overview.html +++ b/invenio_theme_tugraz/templates/invenio_theme_tugraz/overview.html @@ -54,6 +54,7 @@ + {% if can_view_marc21 %}