Repository navigation
fix(console): word the remaining permission refusals as what your access lacks and who grants it - #3745
Merged
Conversation
Save, workspace save, Configuration create, sandbox policy, repository choices and the generic 403 now say what the access does not include and which grant to ask an Installation administrator for. A recheck of an open Agent page and a Slack lookup, which check several grants, show the API's named denial.
…; name the Secret grant when the lookup refusal names none
# Conflicts: # tests/helpers/refusal-text.mjs
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
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.
Problem
After #3733 (finding 2538), the console still wrote its own "You do not have permission to ..." and "Access denied. You do not have permission for this operation." sentences for save and action refusals. These sentences do not follow the console's refusal form: say what the caller's access does not include, then which grant to ask an Installation administrator for. Some named no usable grant ("read access to them", "permission to use its selected Slack bot Secret"). Others said "denied because you are not authorized".
Change
13 console-written refusal forms now use the shared
access-reasons.mtshelpers (notIncluded,askForGrant,askAdministratorTo, newactionRefused). Each one shows where the action was taken:notIncluded("reading this Agent's policy", "SandboxPolicy read on it")and similar. The editing setting says only an Installation administrator who also administers the Agent can change it.Not changed here: the Stop and Delete refusals, and
agentSaveDenial. #3734 rewords them.docs/reference/console.mddescribes the save form.Verification
console-agent-detail,console-status-block,console-agent-repositoriesandtests/conformance/http-errors).b9a9336186, 31 fail and 443 pass. Every form has at least one failing sample. New tests: a refused recheck of an open Agent page, the policy editing setting, Agent repository choices, and a named Slack lookup refusal.tsc --buildis clean, and eslint and prettier are clean on the touched files.Risks
access-reasons.mts,list.mtsandconsole.mjslines near Match rejected-credential recovery to what the operator can do #3734 but not the same hunks. Match rejected-credential recovery to what the operator can do #3734'sstopRefusedanddeleteRefusedcould reuseactionRefusedafter both land.