Repository navigation
Restrict Preferred Outbound changes to super admin / admin (deny agents) #5645
Description
Is your feature request related to a problem? Please describe.
In Admin V2, agents (نماینده / Role.agent) can edit a user’s Preferred Outbound (preferred_outbound in user extra_params) via the Users page and the admin API (PATCH user / users-page).
Preferred Outbound controls which server-side outbound all of that user’s traffic leaves through. In reseller / multi-admin setups this is an owner-level routing policy (often tied to capacity, cost, or upstream accounts). Agents should manage users (quota, days, enable/disable) but should not be able to override the owner’s outbound routing—or clear it back to automatic.
Today there is no role check on this field: the same Users API that agents use accepts preferred_outbound for every role in {super_admin, admin, agent}.
Related UI strings (FA): «خروجی ترجیحی» / users.outbound* and admin default outbound («خروجی پیشفرض»).
Describe the solution you'd like
- Agents must not change Preferred Outbound on users (UI: hide or disable the field; API: reject
preferred_outboundwith403if the actor is an agent). - Optionally also deny agents from changing admin default outbound (
default_outboundon “My account” / admins API) if that is still writable for agents—same policy: outbound routing is owner-controlled. - Keep Preferred Outbound editable for super admin and (if desired) full admin; only agents are restricted.
- Agents may still see the current value (read-only) so they understand routing, unless you prefer to hide it entirely.
Suggested rule of thumb:
super_admin/admin: read + writeagent: read-only (or hidden) — write forbidden in UI and API
Describe alternatives you've considered
- Document “don’t touch outbound” for agents — not enforceable; API still allows it.
- Custom panel patch / reverse proxy ACL — breaks on upgrades; we prefer a first-party permission.
- Separate agent-only user editor without outbound — heavier than a role check on one field.
Additional context
- Panel: Hiddify Manager / Admin V2 (e.g. 14.x)
- Relevant areas: Users page → Preferred Outbound;
users_page_apiapplyingpreferred_outbound; adminsdefault_outbound - This is a permission / multi-tenant safety request, not a request to remove the Preferred Outbound feature.
خلاصه (فارسی):
الان نماینده میتواند «خروجی ترجیحی» کاربر را عوض کند. این تنظیم مسیر خروج ترافیک از سرور است و باید فقط دست ادمین اصلی (و در صورت صلاحدید ادمین کامل) باشد. نماینده فقط مدیریت حجم/روز/فعالسازی کاربر را داشته باشد؛ تغییر outbound در UI و API برای agent ممنوع شود (۴۰۳).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
hiddify-com commentedon Oct 25, 2026
@hiddify-com need attention: agents can change a user's Preferred Outbound from admin v2 and the API, which reroutes all of that user's traffic. This setting should be limited to admins/super admins in both the UI and the API.
hiddify-com commentedon Oct 27, 2026
Implemented in hiddify/HiddifyPanel-old@a0df884 (dev branch, after v14.1.0b1; not in a stable or beta release yet): grantable per-admin capabilities; agents can no longer override Preferred Outbound unless their parent grants it. If something is still missing once this ships, please reopen this issue.