Bug 1011864

Summary: [fork][origin_ui_88]Should give a correct prompt when delete domain with non-owner member
Product: OpenShift Online Reporter: Wei Sun <wsun>
Component: ocAssignee: Clayton Coleman <ccoleman>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.x   
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:11 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 Wei Sun 2013-09-25 09:24:39 UTC
Description of problem:
Create a domain which doesn't have any app,and add edit/view/admin role member .Try to delete this domain with edit/view/admin role member,could not delete domain successfully,but prompt "Your domain contains applications. Delete applications first"

Version-Release number of selected component (if applicable):
fork_ami_origin_ui_72_membership_845
rhc 1.15.0 build from fork_ami_origin_ui_72_membership_845

How reproducible:
Always

Steps to Reproduce:
1.Create a domain which doesn't have any app
2.Add edit/view/admin role member to this domain
3.Try to delete this domain with edit/view/admin role member

Actual results:
1.Domain info
OpenShift:~ openshift$ rhc domain show -n wsunmemfor845
Domain wsunmemfor845 (owned by wsun+member)
------------------------------------------------------
  Created:            4:55 PM
  Allowed Gear Sizes: small
  Members:            wsun (admin), wsun+member1 (edit), wsun+member2 (view)
The domain wsunmemfor845 exists but has no applications. You can use 'rhc create-app' to create a new application.

2.OpenShift:~ openshift$ rhc domain-delete wsunmemfor845 -l  wsun+member1
Password: ******
Deleting domain 'wsunmemfor845' ... Your domain contains applications. Delete applications first.

OpenShift:~ openshift$ rhc domain-delete wsunmemfor845 -l  wsun+member2
Password: ******
Deleting domain 'wsunmemfor845' ... Your domain contains applications. Delete applications first.

OpenShift:~ openshift$ rhc domain-delete wsunmemfor845 -l  wsun
Password: ******
Deleting domain 'wsunmemfor845' ... Your domain contains applications. Delete applications first.


Expected results:
Should prompt "You are not permitted to perform this action "

Additional info:

Comment 1 Clayton Coleman 2013-09-25 19:27:32 UTC
Fixed in a1a3026 in membership branch

Comment 2 Wei Sun 2013-09-26 03:00:07 UTC
Verified on fork_ami_origin_ui_72_membership_863

Delete domain with admin/edit/view role member,will prompt "You are not permitted to perform this action (destroy on domain)"

Result:
[wsun@dhcp-8-229 ~]$ rhc domain show -n wsunfork863
Domain wsunfork863 (owned by wsun+member)
----------------------------------------------------
  Created:            10:54 AM
  Allowed Gear Sizes: small
  Members:            wsun (admin), wsun+mem1 (edit), wsun+1 (view)

The domain wsunfork863 exists but has no applications. You can use 'rhc create-app' to create a new application.
[wsun@dhcp-8-229 ~]$ rhc domain-delete wsunfork863 -l wsun -p redhat
Deleting domain 'wsunfork863' ... You are not permitted to perform this action (destroy on domain)
[wsun@dhcp-8-229 ~]$ rhc domain-delete wsunfork863 -l wsun+mem1 -p redhat
Deleting domain 'wsunfork863' ... You are not permitted to perform this action (destroy on domain)
[wsun@dhcp-8-229 ~]$ rhc domain-delete wsunfork863 -l wsun+1 -p redhat
Deleting domain 'wsunfork863' ... You are not permitted to perform this action (destroy on domain)

Comment 3 Wei Sun 2013-09-26 03:16:45 UTC
rhc build from  fork_ami_origin_ui_72_membership_863