diff --git a/hbd/server/http.py b/hbd/server/http.py index 71a3bf9..dd50a34 100644 --- a/hbd/server/http.py +++ b/hbd/server/http.py @@ -1126,19 +1126,18 @@ async def start( return web.Response(text=body, content_type="text/html") # ------------------------------------------------------------------------- - # Settings page (admin only) + # Settings page # ------------------------------------------------------------------------- async def settings_page(request): - """GET /settings — read-only view of the current server configuration.""" + """GET /settings — server configuration; non-admins see only what they own or manage.""" current_user, _ = _require_auth_redirect(request) - if current_user and not current_user.admin: - raise web.HTTPForbidden(reason="Admin access required") pkg_dir = os.path.dirname(__file__) templates_dir = config.get("templates_dir", os.path.join(pkg_dir, "templates")) env = jinja2.Environment(loader=jinja2.FileSystemLoader(templates_dir), autoescape=True) tmpl = env.get_template("settings.html") - settings_data = settings_mod.get_settings_data(config, threshold_checker=threshold_checker) + settings_data = settings_mod.get_settings_data( + config, threshold_checker=threshold_checker, user=current_user) body = tmpl.render( title="Settings - Heartbeat", sections=settings_data["sections"], diff --git a/hbd/server/templates/nav.html b/hbd/server/templates/nav.html index ab71d5a..ee78ead 100644 --- a/hbd/server/templates/nav.html +++ b/hbd/server/templates/nav.html @@ -6,12 +6,12 @@ Live Dashboard Host Overview Alerts - {% if current_user and current_user.admin %} + {% if current_user %} Settings {% endif %} About - {% if current_user and current_user.admin %} + {% if current_user %} {% endif %}