nordabiz/blueprints/admin
Maciej Pienczyn 4181a2e760 refactor: Migrate access control from is_admin to role-based system
Replace ~170 manual `if not current_user.is_admin` checks with:
- @role_required(SystemRole.ADMIN) for user management, security, ZOPK
- @role_required(SystemRole.OFFICE_MANAGER) for content management
- current_user.can_access_admin_panel() for admin UI access
- current_user.can_moderate_forum() for forum moderation
- current_user.can_edit_company(id) for company permissions

Add @office_manager_required decorator shortcut.
Add SQL migration to sync existing users' role field.

Role hierarchy: UNAFFILIATED(10) < MEMBER(20) < EMPLOYEE(30) < MANAGER(40) < OFFICE_MANAGER(50) < ADMIN(100)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 21:05:22 +01:00
..
__init__.py feat: Add membership application system 2026-02-01 12:38:31 +01:00
CLAUDE.md refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_analytics.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_announcements.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_audits.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_companies.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_insights.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_krs_api.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_membership.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_model_comparison.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_people.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_security.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_social.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_status.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_users_api.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_zopk_dashboard.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_zopk_knowledge.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_zopk_news.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes_zopk_timeline.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00
routes.py refactor: Migrate access control from is_admin to role-based system 2026-02-01 21:05:22 +01:00