Bug 1011669

Summary: New applications do not inherit correct member roles from domain
Product: OpenShift Online Reporter: Jordan Liggitt <jliggitt>
Component: PodAssignee: Clayton Coleman <ccoleman>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: wjiang
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-17 13:31:05 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 Jordan Liggitt 2013-09-24 19:03:23 UTC
Description of problem:
When new applications are created within a domain, the domain members are all assigned the admin role in the application


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


How reproducible:
Always


Steps to Reproduce:
1. Create a domain
2. Add other members to the domain with view, edit, and admin roles
3. Create an application within the domain
4. View the application member info

Actual results:
All members have admin role within the application


Expected results:
Members have identical roles to the domain


Additional info:
Editing the members of the domain once the application is created propagates to the app correctly

Comment 1 Jordan Liggitt 2013-09-24 19:20:50 UTC
Caused by this line:

        p.inherit_membership.each{ |m| m.clear.add_grant(m.role || default_role, parent.name) } if p

The member is always cleared (which removed the member's role), so the default role is always used.

Comment 2 Clayton Coleman 2013-09-25 20:06:01 UTC
Fixed, 0a05e70607b030c68ea33c251bd228f68ee7952d meant that items weren't correctly cloned, and m.role was not pulling the role from the user.

Comment 3 weiwei jiang 2013-09-26 07:50:49 UTC
Tested on fork_ami_origin_ui_72_membership_863 via rhc build from it, and found this issue is fixed, so verify this issue, thx

# rhc app create app php-5.3 --no-git --no-dns 
Application Options
-------------------
  Domain:     wjiang926
  Cartridges: php-5.3
  Gear Size:  default
  Scaling:    no

Creating application 'app' ... done

# rhc member add yujzhang -n wjiang926 --role view
Adding 1 viewer to domain ... done

# rhc member list -t wjiang926/app
Login                 Role
--------------------- -------------
wjiang+926 admin (owner)
yujzhang              view

# rhc app create app2 php-5.3 --no-git --no-dns
Application Options
-------------------
  Domain:     wjiang926
  Cartridges: php-5.3
  Gear Size:  default
  Scaling:    no

Creating application 'app2' ... done

# rhc member list -t wjiang926/app
Login                 Role
--------------------- -------------
wjiang+926 admin (owner)
yujzhang              view
# rhc member list -t wjiang926
Login                 Role
--------------------- -------------
wjiang+926 admin (owner)
yujzhang              view