Improve error message for users with insufficient rights #13369
Labels
backend
frontend
kind/chore
status/ready-for-dev
Status: Used for issues that are ready for development. Has been through grooming.
team/studio-core
Description of the bug
On the "create app" page, we only check if the user is a member of a team in the organization. However, a user could be a member of a team for an organization, but still not have the necessary rights to create a new app. This action requires the rights to create a new repo for the organization.
When this happens, the user is allowed to select the organization from the list, type inn the new app name, and click "create". The request returns an error, because the user is unauthorized. The error states:
"An error has occured. If the problem persists, contact us".
This is very inaccurate. A technical error has occured, in that the user does not have access to perform the action in Gitea. But this is a very clear case, we should catch that it happens and display a specific error message explaining what the problem is.
Steps To Reproduce
Additional Information
I do suspect that we might have to do some error handling backend to fix this - we need to check which response we get from the backend endpoint.
Although fixing the error message is a good first step, we should probably take this further.
The user should not be allowed to actually submit the form to create the service if the org is selected and they have insufficient rights to create an app.
They should be shown a warning/error message instead, and the submit button should be disabled. This would avoid confusion, and reduce questions from our users.
We need to check if we can easily verify the rights of the user for the owner that they have specified. To do this we may need to make some changes to the form as well.
The text was updated successfully, but these errors were encountered: