Bug 1292469 - Deletion of tenant is allowed when group exists with such tenant assigned
Deletion of tenant is allowed when group exists with such tenant assigned
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS (Show other bugs)
5.5.0
Unspecified Unspecified
medium Severity high
: GA
: 5.5.2
Assigned To: Milan Zazrivec
Kyrylo Zvyagintsev
: ZStream
: 1292494 (view as bug list)
Depends On: 1292157 1292494
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-17 09:29 EST by John Prause
Modified: 2016-02-10 10:29 EST (History)
10 users (show)

See Also:
Fixed In Version: 5.5.2.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1292157
Environment:
Last Closed: 2016-02-10 10:29:12 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: Bug
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Prause 2015-12-17 09:29:49 EST
+++ This bug was initially created as a clone of Bug #1292157 +++

Description of problem:
Deletion of tenant is allowed when there is group with this tenant assigned. This will cause that group will loose tenant membership. This is e.g. breaking Automate-Explorer.

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

How reproducible:
always

Steps to Reproduce:
1. Create tenant1
2. Create new group called tenant1, assign super administrator role to it and tenant1 tenant
3. Create new user tenant1 and assign him into tenant1 group
4. Login as tenant1 
5. navigate to Automate -> Explorer

Actual results:
You will see this message on the screen:
We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it shortly.

When you navigate to tenant1 group, there is no tenant assigned to this group, which is mandatory when creating new group.

In order to fix this, login as super administrator of My Company tenant and assign tenant to tenant1 group.

Also noticed that user which is not member of any tenant can login into CFME.

Expected results:
Tenant/child tenant/project cannot be deleted if there is group which is relying on this tenant/project.
This check should be implemented also for all child tenants.
Similar check is done when you try delete group which has members in it.

Additional info:
Comment 2 John Prause 2016-01-06 10:22:41 EST
*** Bug 1292494 has been marked as a duplicate of this bug. ***
Comment 4 CFME Bot 2016-01-07 13:05:12 EST
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=185c624c1d74a8b302f3eeef5e72e2a8a0bf56b7

commit 185c624c1d74a8b302f3eeef5e72e2a8a0bf56b7
Author:     Milan Zazrivec <mzazrivec@redhat.com>
AuthorDate: Wed Jan 6 14:18:05 2016 +0100
Commit:     Milan Zazrivec <mzazrivec@redhat.com>
CommitDate: Thu Jan 7 08:36:00 2016 +0100

    Don't delete tenant with groups associated
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1292469
    (cherry picked from commit 23981a52d869b215c53cb877e6a902d207a24192)

 app/models/tenant.rb       | 5 +++++
 spec/models/tenant_spec.rb | 8 ++++++++
 2 files changed, 13 insertions(+)
Comment 5 CFME Bot 2016-01-07 13:05:18 EST
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=76c5e540b720ee720e19799a49d494bcda9c7354

commit 76c5e540b720ee720e19799a49d494bcda9c7354
Merge: 9fd0e8a 185c624
Author:     Dan Clarizio <dclarizi@redhat.com>
AuthorDate: Thu Jan 7 12:44:47 2016 -0500
Commit:     Dan Clarizio <dclarizi@redhat.com>
CommitDate: Thu Jan 7 12:44:47 2016 -0500

    Merge branch 'fix_deletion_of_tenant_with_groups' into '5.5.z'
    
    Don't delete tenant with groups associated
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1292469
    (cherry picked from commit 23981a52d869b215c53cb877e6a902d207a24192)
    
    See merge request !679

 app/models/tenant.rb       | 5 +++++
 spec/models/tenant_spec.rb | 8 ++++++++
 2 files changed, 13 insertions(+)
Comment 7 Pavol Kotvan 2016-01-19 08:01:04 EST
Verified on 5.5.2.1.20160114044944_395c086.
Comment 8 errata-xmlrpc 2016-02-10 10:29:12 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:0159

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