Publish functionality should have more verbose error messaging and have steps of validation changed
dfoll opened this issue · 3 comments
Bug or Enhancement
When publishing if a user with access to an org, but not access to publish tries to create something, they get a generic message of "Create Service: Unable to create service". We should improve this message to tell them "Create Service: Unable to create service because user does not have permissions." Additionally we should change the workflow of validating the user's permissions. If a user with access to the org but not permissions to publish tries to create an item, using the name of an existing hosted feature service, it tells the user that they cannot publish because that name is not unique. This can be confusing for the user because it gives a false sense of what the problem is... true it cannot publish because the name is unique, but ultimately even if they then make the name unique, they still cannot publish because they do not have permissions, we should do the permissions check first, so they understand right away, that they cannot publish at all because they do not have permissions.
In short, the issue is:
- improve message when user does not have permissions to "Create Service: Unable to create service because user does not have permissions."
- change order of validation to
- Does user have access to org?
- Does user have permissions?
- Is name unique?
Repo Steps or Enhancement details
- Create a grid
- Name grid
- Publish
- Enter credentials of a user with access with permissions (your own account)
verify service is successfully published under your content - Publish (without changing name)
- Enter credentials of a user that does not have access
message is displayed telling the user they do not have access, this is correct - Publish (without changing name)
8 Enter credentials of a user that has access but not permission (testsolutions_defense_viewer)
message is displayed saying the name is not unique, when really the problem is the user does not have permissions - Enter a unique layer name and publish
- Enter credentials of a user that has access but not permission (testsolutions_defense_viewer)
now there is an error that publishing failed, but this should have happened after step 8 and we want that message to be more verbose - Publish (without changing name)
- Enter credentials of a different user than step 4 (testsolutions_defense)
verify service is successfully published under testsolutions_defense content
steps here are not necessary, but just a good follow on to repro
- Publish (without changing name)
- Enter credentials of your user from step 4
error that name is not unique - Enter a unique layer name and publish
- Enter credentials of your account again
verify service is successfully published under your account
Addressed in PR #176
Added a user permissions check before the layer name available check. If the user does not have publisher rights the following error message is displayed:
'Create Service: Unable to create service because user does not have permissions'
I think this use case is rarely going to happen as you must be a lv2 user within the portal to create a web application. Because of the nature of this widget is to create an authorised GRG layer for use across other applications, an application with this widget in it should not be shared to lv1 users.
So I think we have all bases covered.