Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1530162 - Viewer should be able to view and process template for external creation flow
Viewer should be able to view and process template for external creation flow
Status: CLOSED CURRENTRELEASE
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console (Show other bugs)
3.9.0
Unspecified Unspecified
medium Severity low
: ---
: 3.9.0
Assigned To: Robb Hamilton
Yadan Pei
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2018-01-02 03:04 EST by Yadan Pei
Modified: 2018-03-27 05:44 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: The UI did not validate whether or not a user had permissions to create in a selected project during step one of create from URL. Consequence: If the user did not have permission to create in the selected project, a somewhat confusing error occurred upon clicking the next button as the form was considered valid since a project had been selected, but the user did not have permissions to create in the selected project. Fix: Upon selecting a project, the form now checks to see if the user has permissions to add the the project; if not, an inline error message is displayed. Result: The user is given immediate feedback if (s)he does not have permission to create in a selected project.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-01-24 10:56:09 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0489 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.9 RPM Release Advisory 2018-03-28 14:06:38 EDT

  None (edit)
Description Yadan Pei 2018-01-02 03:04:36 EST
Description of problem:
viewer should be granted the permission to go on to view and process template when he is on external creation from template flow. 

Version-Release number of selected component (if applicable):
v3.9.0-0.9.0

How reproducible:
Always

Steps to Reproduce:
1.Cluster admin create template under openshift
$ oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/templates/ui/application-template-stibuild-without-customize-route.json --config=<admin.config>
2.User1 create project and add view role to user2
$ oc new-project test
$ oc policy add-role-to-user view user2 -n test
3.User2 login to web console and access create from template external page
https://<master>/console/create?template=ruby-helloworld-sample&templateParamsMap={%22ADMIN_USERNAME%22:%22adminuser%22}
4.Select project "test" in Choose Existing Project
5.Click Next

Actual results:
5.Error occured with message:
Error
Access denied
You do not have authority to process templates in project test.

Expected results:
5. User2 should be able to go on after click "Next" to view and process the template until he hit "Create",user2 don't have permission to create resources processed from template "ruby-helloworld-sample" in project "test" since user2 is viewer, thus he will get error message.

Additional info:
Comment 1 Jessica Forrester 2018-01-02 08:22:23 EST
I'm pretty sure this was the intentional design so that the user doesn't start filling out a form they won't be able to submit. The user does not have the authority to process templates in that namespace, we have to flag that somewhere. We could potentially do better and warn them at the point where they selected the project. Similar to what we are now doing in the new add to project dialogs.
Comment 2 Robb Hamilton 2018-01-02 12:35:39 EST
For what it's worth, the behavior is consistent with the old catalog (e.g., /project/user1project/create) as create from url simply advances the user in to the old catalog create flow.  I wonder if the simple fix is to remove view-only projects from create from url's choose existing project dropdown (or disable them in the dropdown).  If you can't create in the project, no point letting you select the project?
Comment 3 Samuel Padgett 2018-01-02 12:43:08 EST
It's an expensive check. If you have a lot of projects, it's not practical to filter the list up front unfortunately.
Comment 4 Yadan Pei 2018-01-02 20:35:26 EST
We found the inconsistent behavior in automation testing, in OCP 3.7, viewer was able to go on to fill out the form and get error "An error occurred processing the template" when he submit the creation.

It is better if we could keep consistent behavior?
Comment 5 Samuel Padgett 2018-01-03 09:14:32 EST
I see the message "You are not authorized to add to this project." with the "Create" button disabled in the new 3.7 template dialog. Is that not what you see?
Comment 6 Robb Hamilton 2018-01-03 10:11:40 EST
PR to resolve: https://github.com/openshift/origin-web-console/pull/2622
Comment 7 Yadan Pei 2018-01-03 20:44:03 EST
(In reply to Samuel Padgett from comment #5)
> I see the message "You are not authorized to add to this project." with the
> "Create" button disabled in the new 3.7 template dialog. Is that not what
> you see?

Attached gif is what I see when creating from url with viewer
Comment 10 Samuel Padgett 2018-01-04 08:39:32 EST
Robb's fix from comment #6 should make the two consistent where you see the error when picking the project.
Comment 11 Yadan Pei 2018-01-04 20:21:52 EST
Yeah, I will give a test after getting a testable puddle
Comment 13 Yadan Pei 2018-01-22 21:22:56 EST
Same issue with bug 1510786

Move to VERIFIED

Note You need to log in before you can comment on or make changes to this bug.