feat: 配置功能仅admin可用,operator隐藏配置按钮+后端403拦截

- devices.html: 注入 USER_ROLE 全局变量
- devices.js: 配置按钮仅 USER_ROLE===admin 时渲染
- fixture.py: 页面/指令/保存三个路由均校验 admin 角色
This commit is contained in:
wangfq
2026-06-09 15:36:08 +08:00
parent e863dfbe2f
commit 8aaa8440d1
3 changed files with 10 additions and 1 deletions

View File

@@ -20,5 +20,8 @@
{% endblock %}
{% block scripts %}
<script>
const USER_ROLE = "{{ current_user.role }}";
</script>
<script src="{{ url_for('static', filename='js/devices.js') }}"></script>
{% endblock %}