Bug 1288512 - Tenant automation domains - undefined method `first' for nil:NilClass [miq_ae_class/x_button]
Tenant automation domains - undefined method `first' for nil:NilClass [miq_ae...
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 unspecified
: GA
: 5.6.0
Assigned To: Harpreet Kataria
Pavol Kotvan
ui
: ZStream
Depends On:
Blocks: 1293741
  Show dependency treegraph
 
Reported: 2015-12-04 08:13 EST by Pavol Kotvan
Modified: 2016-06-29 11:17 EDT (History)
5 users (show)

See Also:
Fixed In Version: 5.6.0.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1293741 (view as bug list)
Environment:
Last Closed: 2016-06-29 11:17:56 EDT
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 Pavol Kotvan 2015-12-04 08:13:01 EST
Description of problem:
Tenant user has access to Configuration button even when no writeable domain exists. This behaviour is seen when there is another tenant configured with his own writeable Automation domain. 

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

How reproducible:
always

Steps to Reproduce:
1. Configure LDAP authentication on CFME
2. Create 2 different parent-tenants
- marketing
- finance
3. Create groups marketing and finance (these are defined in LDAP). Group names in LDAP and CFME must match.
4. Assign these groups to corresponding tenants and assign them EvmRole-SuperAdministrator roles

5. Login as a member of finance group (user must exists in LDAP DB)
6. Create new Automation domain and copy ManageIQ/System/Request/InspectMe instance and ManageIQ/System/Request/new_method method to new domain

7. Follow steps 6. but login as another user who is member of marketing group and repeat the same, except do not create new Domain, but navigate directly to ManageIQ/System/Request/InspectMe -> Configuration -> Copy this instance

Workaround: 
User must create his own new Domain first.

Actual results:
undefined method `first' for nil:NilClass [miq_ae_class/x_button] 

Expected results:
Configuration buton should not be available, because tenant did  not create his writeable Domain and there is no writeable domain available (other domains are locked).

Additional info:
Maybe above steps will work without LDAP authentication, I did not try that option.
Comment 2 Harpreet Kataria 2016-01-05 14:18:53 EST
https://github.com/ManageIQ/manageiq/pull/6045
Comment 3 CFME Bot 2016-01-05 18:36:00 EST
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/985b38455a2cce2fe1933a6bf6a2717fe8de5766

commit 985b38455a2cce2fe1933a6bf6a2717fe8de5766
Author:     Harpreet Kataria <hkataria@redhat.com>
AuthorDate: Fri Dec 18 13:53:06 2015 -0500
Commit:     Harpreet Kataria <hkataria@redhat.com>
CommitDate: Tue Jan 5 15:20:30 2016 -0500

    Fixed button visibility of buttons in automate explorer.
    
    Added code to only make certain buttons visible when user's current tenant has any editable domains.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1288512
    https://bugzilla.redhat.com/show_bug.cgi?id=1293741

 app/helpers/application_helper/toolbar_builder.rb     |  2 +-
 app/models/tenant.rb                                  |  4 ++++
 .../application_helper/toolbar_builder_spec.rb        | 10 ++++++++++
 spec/models/tenant_spec.rb                            | 19 +++++++++++++++++++
 4 files changed, 34 insertions(+), 1 deletion(-)
Comment 5 CFME Bot 2016-01-06 11:42:27 EST
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=edfb5602bb41c63c915b1b6ecdb130d795b8e1ff

commit edfb5602bb41c63c915b1b6ecdb130d795b8e1ff
Author:     Harpreet Kataria <hkataria@redhat.com>
AuthorDate: Fri Dec 18 13:53:06 2015 -0500
Commit:     Harpreet Kataria <hkataria@redhat.com>
CommitDate: Wed Jan 6 10:39:22 2016 -0500

    Fixed button visibility of buttons in automate explorer.
    
    Added code to only make certain buttons visible when user's current tenant has any editable domains.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1288512
    https://bugzilla.redhat.com/show_bug.cgi?id=1293741
    (cherry picked from commit 985b384)

 app/helpers/application_helper/toolbar_builder.rb     |  2 +-
 app/models/tenant.rb                                  |  4 ++++
 .../application_helper/toolbar_builder_spec.rb        | 10 ++++++++++
 spec/models/tenant_spec.rb                            | 19 +++++++++++++++++++
 4 files changed, 34 insertions(+), 1 deletion(-)
Comment 6 CFME Bot 2016-01-06 11:42:42 EST
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=ed55df70e10f15f1a166f6688509e7993fc8a159

commit ed55df70e10f15f1a166f6688509e7993fc8a159
Merge: 00b549c edfb560
Author:     Dan Clarizio <dclarizi@redhat.com>
AuthorDate: Wed Jan 6 11:38:45 2016 -0500
Commit:     Dan Clarizio <dclarizi@redhat.com>
CommitDate: Wed Jan 6 11:38:45 2016 -0500

    Merge branch '55z_pr_6045' into '5.5.z'
    
    Fixed button visibility of buttons in automate explorer.
    
    Added code to only make certain buttons visible when user's current tenant has any editable domains.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1288512
    https://bugzilla.redhat.com/show_bug.cgi?id=1293741
    (cherry picked from commit 985b384)
    
    @dclarizi please merge, clean cherry-pick for https://github.com/ManageIQ/manageiq/pull/6045
    
    See merge request !677

 app/helpers/application_helper/toolbar_builder.rb     |  2 +-
 app/models/tenant.rb                                  |  4 ++++
 .../application_helper/toolbar_builder_spec.rb        | 10 ++++++++++
 spec/models/tenant_spec.rb                            | 19 +++++++++++++++++++
 4 files changed, 34 insertions(+), 1 deletion(-)
Comment 9 errata-xmlrpc 2016-06-29 11:17:56 EDT
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:1348

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