feat: better admin permissions (#5755)

* feat: add casbin admin permissions

* feat: improve audit logging to associate logs with actual operators and target users

* feat: enhance admin permissions and UI interactions for sensitive actions

* Refactor authz RBAC and tighten channel permissions

* Split channel authz field policy

* Address channel authz review findings
This commit is contained in:
Calcium-Ion
2026-06-27 17:01:59 +08:00
committed by GitHub
parent 6c35e1ef26
commit 4aee5f7d5a
52 changed files with 2778 additions and 255 deletions
+23 -3
View File
@@ -223,8 +223,10 @@
"Admin": "Admin",
"Admin access required": "Admin access required",
"Admin area": "Admin area",
"Admin Channel Permissions": "Admin Channel Permissions",
"Admin notes (only visible to admins)": "Admin notes (only visible to admins)",
"Admin Only": "Admin Only",
"Admin Permissions": "Admin Permissions",
"Administer user accounts and roles.": "Administer user accounts and roles.",
"Administrator account": "Administrator account",
"Administrator username": "Administrator username",
@@ -716,6 +718,7 @@
"Channel ID is required": "Channel ID is required",
"Channel key": "Channel key",
"Channel key unlocked": "Channel key unlocked",
"Channel Management": "Channel Management",
"Channel models": "Channel models",
"Channel name is required": "Channel name is required",
"Channel test completed": "Channel test completed",
@@ -1075,6 +1078,7 @@
"Create cache": "Create cache",
"Create cache ratio": "Create cache ratio",
"Create Channel": "Create Channel",
"Create channels or edit keys, base URLs, and overrides.": "Create channels or edit keys, base URLs, and overrides.",
"Create Code": "Create Code",
"Create credentials for the root user": "Create credentials for the root user",
"Create deployment": "Create deployment",
@@ -1193,6 +1197,7 @@
"Default": "Default",
"Default (New Frontend)": "Default (New Frontend)",
"Default / range": "Default / range",
"Default administrator permissions can be overridden for this user.": "Default administrator permissions can be overridden for this user.",
"Default API Version *": "Default API Version *",
"Default API version for this channel": "Default API version for this channel",
"Default Bearer": "Default Bearer",
@@ -1380,8 +1385,8 @@
"Drawing": "Drawing",
"Drawing logs": "Drawing logs",
"Drawing Logs": "Drawing Logs",
"Drawing task records": "Drawing task records",
"Drawing task polling": "Drawing task polling",
"Drawing task records": "Drawing task records",
"Duplicate": "Duplicate",
"Duplicate group names: {{names}}": "Duplicate group names: {{names}}",
"Duplicate source model mappings are not allowed": "Duplicate source model mappings are not allowed",
@@ -1448,6 +1453,7 @@
"Edit API Shortcut": "Edit API Shortcut",
"Edit billing ratios and user-selectable groups in one table.": "Edit billing ratios and user-selectable groups in one table.",
"Edit Channel": "Edit Channel",
"Edit channel routing": "Edit channel routing",
"Edit chat preset": "Edit chat preset",
"Edit discount tier": "Edit discount tier",
"Edit FAQ": "Edit FAQ",
@@ -1458,6 +1464,7 @@
"Edit model": "Edit model",
"Edit Model": "Edit Model",
"Edit model pricing": "Edit model pricing",
"Edit non-sensitive settings such as models, groups, and routing rules.": "Edit non-sensitive settings such as models, groups, and routing rules.",
"Edit OAuth Provider": "Edit OAuth Provider",
"Edit payment method": "Edit payment method",
"Edit Prefill Group": "Edit Prefill Group",
@@ -1465,6 +1472,7 @@
"Edit ratio override": "Edit ratio override",
"Edit Rule": "Edit Rule",
"Edit selectable group": "Edit selectable group",
"Edit sensitive channel settings": "Edit sensitive channel settings",
"Edit Tag": "Edit Tag",
"Edit Tag:": "Edit Tag:",
"Edit Uptime Kuma Group": "Edit Uptime Kuma Group",
@@ -2799,6 +2807,7 @@
"No payment methods configured. Click \"Add method\" or use templates to get started.": "No payment methods configured. Click \"Add method\" or use templates to get started.",
"No payment methods match your search": "No payment methods match your search",
"No performance data available": "No performance data available",
"No permission to perform this action": "No permission to perform this action",
"No plans available": "No plans available",
"No preference": "No preference",
"No prefill groups yet": "No prefill groups yet",
@@ -2974,6 +2983,7 @@
"OpenAIMax": "OpenAIMax",
"OpenRouter": "OpenRouter",
"opens in an external client. Trigger it from the sidebar or API key actions to launch the configured application.": "opens in an external client. Trigger it from the sidebar or API key actions to launch the configured application.",
"Operate channels": "Operate channels",
"Operation": "Operation",
"operation and charging behavior": "operation and charging behavior",
"Operation Audit Info": "Operation Audit Info",
@@ -3432,6 +3442,7 @@
"Raw Quota": "Raw Quota",
"Re-enable on success": "Re-enable on success",
"Re-login": "Re-login",
"Read channels": "Read channels",
"Ready": "Ready",
"Ready to initialize": "Ready to initialize",
"Ready to simplify": "Ready to simplify",
@@ -3603,6 +3614,7 @@
"Reroll": "Reroll",
"Research, analysis, scientific reasoning": "Research, analysis, scientific reasoning",
"Resend ({{seconds}}s)": "Resend ({{seconds}}s)",
"Reserved for viewing complete channel keys after secure verification.": "Reserved for viewing complete channel keys after secure verification.",
"Reset": "Reset",
"Reset 2FA": "Reset 2FA",
"Reset 2FA for {{username}}? The user must set up 2FA again to continue using it.": "Reset 2FA for {{username}}? The user must set up 2FA again to continue using it.",
@@ -3739,7 +3751,6 @@
"Save Preferences": "Save Preferences",
"Save preview": "Save preview",
"Save rate limits": "Save rate limits",
"Save token limits": "Save token limits",
"Save sensitive words": "Save sensitive words",
"Save Settings": "Save Settings",
"Save sidebar modules": "Save sidebar modules",
@@ -3748,6 +3759,7 @@
"Save Stripe settings": "Save Stripe settings",
"Save these backup codes in a safe place. Each code can only be used once.": "Save these backup codes in a safe place. Each code can only be used once.",
"Save these codes in a safe place. Each code can only be used once.": "Save these codes in a safe place. Each code can only be used once.",
"Save token limits": "Save token limits",
"Save tool prices": "Save tool prices",
"Save Waffo Pancake settings": "Save Waffo Pancake settings",
"Save Worker settings": "Save Worker settings",
@@ -3891,6 +3903,7 @@
"Send email alerts when a user falls below this quota": "Send email alerts when a user falls below this quota",
"Send reset email": "Send reset email",
"Sending...": "Sending...",
"Sensitive channel settings are read-only for your account.": "Sensitive channel settings are read-only for your account.",
"Sensitive Words": "Sensitive Words",
"Sent the API key to FluentRead.": "Sent the API key to FluentRead.",
"Separate image/audio prices are enabled.": "Separate image/audio prices are enabled.",
@@ -3976,11 +3989,11 @@
"Simple mode only returns message; status code and error type use system defaults.": "Simple mode only returns message; status code and error type use system defaults.",
"Simple mode: prune objects by type, e.g. redacted_thinking.": "Simple mode: prune objects by type, e.g. redacted_thinking.",
"Single Key": "Single Key",
"Skip async task polling delay": "Skip async task polling delay",
"Site & Branding": "Site & Branding",
"Site Key": "Site Key",
"Size:": "Size:",
"sk_xxx or rk_xxx": "sk_xxx or rk_xxx",
"Skip async task polling delay": "Skip async task polling delay",
"Skip retry on failure": "Skip retry on failure",
"Skip SMTP TLS certificate verification": "Skip SMTP TLS certificate verification",
"Skip to Main": "Skip to Main",
@@ -4206,6 +4219,7 @@
"Test all {{count}} models": "Test all {{count}} models",
"Test All Channels": "Test All Channels",
"Test Channel Connection": "Test Channel Connection",
"Test channels, refresh balances, and enable/disable individual, batch, or tagged channels.": "Test channels, refresh balances, and enable/disable individual, batch, or tagged channels.",
"Test Connection": "Test Connection",
"Test connectivity for:": "Test connectivity for:",
"Test failed": "Test failed",
@@ -4739,6 +4753,8 @@
"Vidu": "Vidu",
"View": "View",
"View all currently available models": "View all currently available models",
"View channel lists and details without secrets.": "View channel lists and details without secrets.",
"View channel secrets": "View channel secrets",
"View detailed information about this user including balance, usage statistics, and invitation details.": "View detailed information about this user including balance, usage statistics, and invitation details.",
"View details": "View details",
"View document": "View document",
@@ -4881,8 +4897,10 @@
"You can close this tab once the binding completes or a success message appears in the original window.": "You can close this tab once the binding completes or a success message appears in the original window.",
"You can manually add them in \"Custom Model Names\", click \"Fill\" and then submit, or use the operations below to handle automatically.": "You can manually add them in \"Custom Model Names\", click \"Fill\" and then submit, or use the operations below to handle automatically.",
"You can only check in once per day": "You can only check in once per day",
"You can still edit non-sensitive operations fields such as models, groups, priority, and weight.": "You can still edit non-sensitive operations fields such as models, groups, priority, and weight.",
"You commit not to use this system to implement, assist with, or indirectly implement acts that violate applicable laws and regulations, regulatory requirements, platform rules, public interests, or the lawful rights and interests of third parties.": "You commit not to use this system to implement, assist with, or indirectly implement acts that violate applicable laws and regulations, regulatory requirements, platform rules, public interests, or the lawful rights and interests of third parties.",
"You commit to using upstream APIs, accounts, keys, quotas, and service capabilities only within the scope of lawful authorization obtained from upstream service providers, model service providers, or relevant rights holders, and will not conduct unauthorized resale, trafficking, distribution, or other non-compliant commercialization.": "You commit to using upstream APIs, accounts, keys, quotas, and service capabilities only within the scope of lawful authorization obtained from upstream service providers, model service providers, or relevant rights holders, and will not conduct unauthorized resale, trafficking, distribution, or other non-compliant commercialization.",
"You do not have permission to edit sensitive channel settings.": "You do not have permission to edit sensitive channel settings.",
"You don't have necessary permission": "You don't have necessary permission",
"You have legally obtained authorization for the connected model APIs, accounts, keys, and quotas.": "You have legally obtained authorization for the connected model APIs, accounts, keys, and quotas.",
"You have unsaved changes": "You have unsaved changes",
@@ -4893,6 +4911,8 @@
"You understand this compliance reminder is only for risk notice and does not constitute legal advice, a compliance review conclusion, or a guarantee of the legality of your use of this system; you should consult professional legal or compliance advisors based on your actual business scenario.": "You understand this compliance reminder is only for risk notice and does not constitute legal advice, a compliance review conclusion, or a guarantee of the legality of your use of this system; you should consult professional legal or compliance advisors based on your actual business scenario.",
"You will be redirected to Telegram to complete the binding process.": "You will be redirected to Telegram to complete the binding process.",
"You'll be redirected automatically. You can return to the previous page if nothing happens after a few seconds.": "You'll be redirected automatically. You can return to the previous page if nothing happens after a few seconds.",
"Your account can edit sensitive channel settings.": "Your account can edit sensitive channel settings.",
"Your account cannot edit sensitive channel settings.": "Your account cannot edit sensitive channel settings.",
"your AI integration?": "your AI integration?",
"Your Azure OpenAI endpoint URL": "Your Azure OpenAI endpoint URL",
"Your Bot Name": "Your Bot Name",