Bug 1388060

Summary: [userinterface_public_502] Web should not add user to rolebinding again if the user is already in it
Product: OpenShift Container Platform Reporter: Xingxing Xia <xxia>
Component: Management ConsoleAssignee: bpeterse
Status: CLOSED CURRENTRELEASE QA Contact: Yadan Pei <yapei>
Severity: low Docs Contact:
Priority: medium    
Version: 3.4.0CC: aos-bugs, jforrest, jokerman, mmccomas, spadgett
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1426118 (view as bug list) Environment:
Last Closed: 2016-12-13 15:28:00 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:

Description Xingxing Xia 2016-10-24 10:45:52 UTC
Description of problem:
Web should not add user to rolebinding again if the user is already in it

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

How reproducible:
Always

Steps to Reproduce:
1. Login to web console, create project
2. Go to "Resources" -> "Membership", click "Edit Membership"
3.
1> Add role to user: input user name "bob", select "view", click "Add"
2> Then check rolebinding in CLI:
$ oc get rolebinding view

4. Do step 3 again.

Actual results:
3.
2> It shows:
view                    /view                      bob

4. 
2> It adds bob twice and shows:
view                    /view                      bob, bob

Expected results:
4.
2> Should not add bob again into the rolebinding. Because:
A. If step 4 is done via CLI `oc policy add-role-to-user view bob`, bob is not added again.
B. https://github.com/openshift/origin-web-console/pull/562#issue-178108708 says it: "On add, check for duplicates,do not add a user/group/etc to a rolebinding if already present in the specified rolebinding"

Additional info:

Comment 1 bpeterse 2016-11-01 20:36:09 UTC
PR open for this https://github.com/openshift/origin-web-console/pull/788

Comment 2 Jessica Forrester 2016-11-08 14:44:56 UTC
This was fixed

Comment 3 Xingxing Xia 2016-11-09 02:26:35 UTC
Verified in openshift v3.4.0.23+24b1a58. Now duplicate adding is checked and will prompt message: the role is already granted to user.
I'd like to move to VERIFIED (skip the ON_QA status)
Thank you :)