cloudfoundry / cli

The official command line client for Cloud Foundry
https://docs.cloudfoundry.org/cf-cli
Apache License 2.0
1.75k stars 927 forks source link

For OrgManagers trying to push apps without SpaceDeveloper role, give a more precise error than "You are not authorized" #1348

Open brittag opened 6 years ago

brittag commented 6 years ago

Command

cf push APPNAME

What occurred

When you're an Org Manager or a Space Manager and you push an app without giving yourself Space Developer permission, you get a simple error message that says you're not authorized to do that:

Creating app APPNAME... You are not authorized to perform the requested action FAILED

I've observed that this is confusing to new Cloud Foundry users, because they intuitively understand that the Org Manager (or Space Manager) has enough authorization to be able to push applications. They get to this error message and feel confused. They've simply missed the step that they need to specifically give themselves the permission to push apps by giving themselves the Space Developer role.

What you expected to occur

I suggest that the error message in this case can be more helpful, something like the following:

Creating app APPNAME... You are not authorized to perform the requested action, because you do not have the Space Developer role for this space. You have the Org Manager role, so you can give yourself the Space Developer role and then push this app. FAILED

I understand if this is tricky to implement with the current error message system, but I believe that something like this would be very helpful for excellent user experience for brand-new Cloud Foundry users, across many CF deployments. Thank you!

CLI Version

cf version 6.35.2+88a03e995.2018-03-15

CC API Endpoint Version

api version: 2.104.0

cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/156114850

The labels on this github issue will be updated when the story is started.

XenoPhex commented 6 years ago

Makes sense, we might reduce some of the wording in what you suggested, but the message should include the required role necessary to push an application.

brittag commented 6 years ago

Cool, thanks! Definitely feel free to rewrite the language.

abbyachau commented 4 years ago

@Gerg what do you think about changing the API error message to be more helpful on v7 CLI?

Gerg commented 4 years ago

The You are not authorized to perform the requested action error is generic across all API endpoints. We could try to make the error more helpful, but it would probably need to be part of a larger, API-wide effort.

cc @ssisil @selzoc @pivotalrobbie

sunqb commented 4 years ago

still not fix

github-actions[bot] commented 5 days ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed.