Bug 1540490

Summary: Project viewer unable to set web console homepage to any project overview page when more than one project
Product: OpenShift Container Platform Reporter: Yadan Pei <yapei>
Component: Management ConsoleAssignee: David Taylor <dtaylor>
Status: CLOSED CURRENTRELEASE QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.9.0CC: aos-bugs, jokerman, mmccomas, spadgett, yapei
Target Milestone: ---   
Target Release: 3.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-22 12:49:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yadan Pei 2018-01-31 08:28:09 UTC
Description of problem:
When project viewer has view permission on more than one projects, he is unable to set web console homepage to any project overview page although he has view access

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

How reproducible:
Always

Steps to Reproduce:
1.user1 create two projects, test1 and test2. Grant user2 view permission on test1 first 
$ oc new-project test1
$ oc new-project test2
$ oc policy add-role-to-user view user2 -n test1
2.user2 login to web console,click Set Home page, choose "Overview Page for test1" and Save
3.Grant user2 view permission on test2 too.
$ oc policy add-role-to-user view user2 -n test2
4.click Set Home page, select "Overview Page for", choose test1 or test2 from dropdown list

Actual results:
2.When there is only one project, user2 is able to set home page to project test1 overview page
4.user2 couldn't set home page to any project overview page and we could see error "You are not authorized to add to this project", when this error happens, other options are disabled too and user could not change home page preference

Expected results:
4.Viewer should be able to set homepage to any project overview page although he has view access

Additional info:

Comment 1 David Taylor 2018-02-01 14:46:15 UTC
I am able to reproduce this, there error is coming from the <select-project> dropdown component in Catalog.  It is a form validation error.  Probably need a way to bypass this 'canI' form validation in this scenario...investigating.

Comment 2 Samuel Padgett 2018-02-01 23:13:10 UTC
Right, you might still want to set a project as your homepage that you only have view access to. We don't need the canI check since if you see it in the list at all you have some level of access.

Comment 3 David Taylor 2018-02-05 13:46:14 UTC
Merged PR https://github.com/openshift/origin-web-console/pull/2759

Comment 5 Yadan Pei 2018-02-22 06:11:31 UTC
Checked on OpenShift Web Console: v3.9.0-0.47.0

Project viewer now is able to set home page to any one of project he has view access