Generic error displayed when approval path window is triggered by user without 'View approval path on work item page' permission
Description
If Permission Scheme is enabled in Approval Path and a user without the ‘View approval path on work item page’ permission opens the AP window in a work item (e.g. by clicking the ‘Open approval’ floating button in global approvals list), a generic error will be displayed:
Approval PathFailed to load approval data
We should ensure a clear message about insufficient user permissions is displayed in this scenario.
Cause
'Open approval' opens the work item with the approval dialog for every user. The dialog showed the 'no permission' screen only in Confluence; in Jira it hid its content and still loaded the approvals, which the server refuses since AP-2493, so an empty dialog and the generic 'Failed to load approval data' flag appeared.
Change
-
The approval dialog (Jira and Confluence) now says 'You don't have permission to view Approval Path on this work item' (on this page in Confluence), names the missing permission ('View approval path on work item page' / 'View Approval Path on page') and links the permission schemes documentation.
-
Nothing is loaded for a user who cannot see Approval Path, so no error flag appears.
-
The no-access message uses the app's standard warning message (the same as other no-access views) instead of the old 'Access is restricted' card, whose Marketplace link the Forge sandbox blocked.
Decisions
-
The work item panel stays hidden for users without the permission, as before; only the dialog shows the message.
-
The dialog keeps its usual size: it is opened before the app knows the user's permissions.
Fixes included
-
The hidden work item panel could raise a 'Failed to load approval data' or 'Failed to load definitions data' flag for users without the permission; it no longer loads anything for them.
-
A JSM agent or customer whose Approval Path access is turned off in the JSM settings got an empty approval dialog; it now says 'Approval Path is not enabled for your account. Contact your administrator.'
Manual tester notes
-
Approval Path settings, Permissions: turn on the Work item page Jira Permission Scheme and save. Make sure a test user has no 'View approval path on work item page' grant in the space's permission scheme.
-
As an admin, open Approvals in the global view, hover an approval of that space and copy its 'Open approval' link; open it as the test user.
-
Expected: the Approval Path dialog shows 'You don't have permission to view Approval Path on this work item' with the permission name and a Read more link; no 'Failed to load approval data' flag.
-
Open a work item of that space without the link as the test user: no Approval Path panel and no error flag.
-
Confluence: turn on the Page Permission Scheme with no groups and open an approval's 'Open approval' link: the dialog says 'on this page' and names 'View Approval Path on page'.
-
Turn the schemes back off afterwards.