Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access show cost by in chargeback report for restricted user #3494

Conversation

lpichler
Copy link
Contributor

@lpichler lpichler commented Feb 28, 2018

Needed backend PR:

After/Before

RBAC setup in after GIF
zxesujlpud

see owner

before

screen shot 2018-02-28 at 14 35 16

after

pg6zsv9fll

Technically

  1. in this PR there is moving chargeback related code to one method and then usage of this method and executing when your click on filter tab:
Move chargeback code to the method
and then move this method to the building screen
it will refresh `@edit[:cb_users]` and
`@edit[:cb_tenant]`  when tab filter is pressed.
  1. Allowing listing of users and tenants for restricted user, so there is no case of admin and restricted users, so this old code is transformed to
  if admin_user?		
      @edit[:cb_users] = User.all.each_with_object({}) { |u, h| h[u.userid] = u.name }		
      @edit[:cb_tenant] = Tenant.all.each_with_object({}) { |t, h| h[t.id] = t.name }		
    else		
      @edit[:new][:cb_show_typ] = "owner"		
      @edit[:new][:cb_owner_id] = session[:userid]		
      @edit[:cb_owner_name] = current_user.name		
    end

to

 @edit[:cb_users] = User.all.each_with_object({}) { |u, h| h[u.userid] = u.name }		
  @edit[:cb_tenant] = Tenant.all.each_with_object({}) { |t, h| h[t.id] = t.name }		
  1. wrap listing of users and tenants by RBAC call

Links

@miq-bot assign @mzazrivec
cc @gtanzillo
@miq-bot add_label bug, chargeback, graprindashvili/yes

@miq-bot
Copy link
Member

miq-bot commented Feb 28, 2018

@lpichler Cannot apply the following labels because they are not recognized: chargeback, graprindashvili/yes

@lpichler
Copy link
Contributor Author

@miq-bot add_label gaprindashvili/yes

@lpichler lpichler force-pushed the add_rbac_to_report_definition_on_users_and_tenants branch from b283dc0 to 8e821ce Compare February 28, 2018 15:52
and then move this method to the building screen
it will refresh @edit[:cb_users] and
@edit[:cb_tenant]  when tab filter is pressed.

This change also wrapping tenant and user list
by RBAC.
@lpichler lpichler force-pushed the add_rbac_to_report_definition_on_users_and_tenants branch from 8e821ce to 29d2137 Compare February 28, 2018 16:56
@miq-bot
Copy link
Member

miq-bot commented Feb 28, 2018

Checked commit lpichler@29d2137 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 0 offenses detected
Everything looks fine. 👍

@lpichler
Copy link
Contributor Author

lpichler commented Mar 7, 2018

@mzazrivec backend PR has been merged

@lpichler
Copy link
Contributor Author

lpichler commented Mar 7, 2018

@miq-bot remove_label 'pending core'

@miq-bot
Copy link
Member

miq-bot commented Mar 7, 2018

@lpichler Cannot remove the following label because they are not recognized: 'pending core'

@mzazrivec mzazrivec added this to the Sprint 81 Ending Mar 12, 2018 milestone Mar 8, 2018
@mzazrivec mzazrivec merged commit e81f74e into ManageIQ:master Mar 8, 2018
@lpichler lpichler deleted the add_rbac_to_report_definition_on_users_and_tenants branch March 8, 2018 11:22
simaishi pushed a commit that referenced this pull request Mar 9, 2018
…on_users_and_tenants

Access show cost by in chargeback report for restricted user
(cherry picked from commit e81f74e)

https://bugzilla.redhat.com/show_bug.cgi?id=1553776
@simaishi
Copy link
Contributor

simaishi commented Mar 9, 2018

Gaprindashvili backport details:

$ git log -1
commit f26b6ca8c9c15168cd7e530f995e384b49bad29e
Author: Milan Zázrivec <[email protected]>
Date:   Thu Mar 8 10:22:26 2018 +0100

    Merge pull request #3494 from lpichler/add_rbac_to_report_definition_on_users_and_tenants
    
    Access show cost by in chargeback report for restricted user
    (cherry picked from commit e81f74e044f121f39b6a6786baa6445e10cba2e0)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1553776

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants