Conversation
…icate resolve logic
Contributor
Author
|
This PR is ready for review, Please check it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR about?
This PR adds AI access controls to Enterprise Custom Roles, resolving issue #5487 .
What this PR does
aimodule to the Custom Roles settings, allowing admins to selectively grant users access to Read, Create, Update, or Delete AI configurations.Security Model: Write-Only API Key Masking
To prevent AI API keys from leaking, this PR implements a strict "write-only" security model, identical to how major platforms handle sensitive inputs (e.g., GitHub Actions Secrets, Cloudflare Workers):
********), guaranteeing the real key cannot be stolen via the browser's Network tab. In the UI fields, users will only ever see this********placeholder.masked stringupon form submission is intentionally treated as a deliberate attempt to update the key. However, if the API key field is left untouched, authorized user or admin can change other options (like the model or URL) and it will work seamlessly without breaking the existing key.updatepermission, no random user can accidentally alter or break the key. If an authorized user or admin chooses to overwrite it, it is safely assumed they have the authority to retrieve a new key from their provider or have the old one safely stored. This perfectly mirrors GitHub Repository Secrets (where editing an existing secret shows a blank box that must be overwritten) and Cloudflare Worker Secrets (where secrets become[hidden]forever).What was skipped intentionally
(Note: These items were intentionally omitted to maintain scope strictly on Enterprise Custom Roles)
memberrole. This area was skipped as this PR is strictly targeted at unlocking permissions for Enterprise Custom Roles.(Note: The ability to manage organization-wide "Custom AI Presets" introduced in PR #4882 remains strictly locked to Organization Admins and cannot be delegated to custom roles.)
Checklist
Before submitting this PR, please make sure that:
canarybranch has been created.Issues related (if applicable)
closes #5487
Screenshots (if applicable)
The PR appears safe to merge; no outstanding authorization, tenant-isolation, credential-exposure, or other actionable regression was established.
Summary
This PR adds AI as an enterprise custom-role resource and applies granular AI permissions throughout the settings UI and API.
Reviews (6) · Last reviewed commit: "perf(ai): optimize permission evaluation..."