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

Mark rbac_tenant_manage_quotas as MY TENANT FEATURE #18322

Merged

Conversation

lpichler
Copy link
Contributor

@lpichler lpichler commented Jan 3, 2019

Extending: #18151

will be used for

This PR is based recent feature called Dynamic product features according to tenants:

Scenario:
Let's have tenant structure:

My Company
|--->  Alpha (user alpha)
       |---> Omega (user omega)

According to the BZ user alpha needs to have forbidden access to managing quotas for tenant Alpha (user alpha) and allowed to managing quotas.

We can use for this recent feature called Dynamic product features according to tenants
that we will authorise dynamic tenant product features (rbac_tenant_manage_quotas_tenant_<TENANT ID where we want/don't want to manage tenant quotas >) to access managing quotas of .

To accomplish this we need to change places where we are authorising rbac_tenant_manage_quotas_tenant to rbac_tenant_manage_quotas_tenant_<TENANT ID where we want/don't want to manage tenant quotas >

This places are in UI and API in the PRs above

User alpha has this setting in role (rbac_tenant_manage_quotas_tenant is checked just for Omega Tenant)
screenshot 2019-01-03 at 16 37 36
which will forbid managing for tenant alpha

screenshot 2019-01-03 at 16 49 49
and allow manage quotas for omega tenant

screenshot 2019-01-03 at 16 50 00

This is done in UI PR ^.

Links

@miq-bot add_label enhancement, blocker
@miq-bot assign @gtanzillo

@lpichler
Copy link
Contributor Author

lpichler commented Jan 3, 2019

@miq-bot add_label hammer/yes

@@ -33,7 +33,8 @@ class MiqProductFeature < ApplicationRecord
REQUIRED_ATTRIBUTES = [:identifier].freeze
OPTIONAL_ATTRIBUTES = %i(name feature_type description children hidden protected).freeze
ALLOWED_ATTRIBUTES = (REQUIRED_ATTRIBUTES + OPTIONAL_ATTRIBUTES).freeze
TENANT_FEATURE_ROOT_IDENTIFIERS = %w(dialog_new_editor dialog_edit_editor dialog_copy_editor dialog_delete rbac_tenant_manage_quotas).freeze
SELF_TENANT_FEATURE_ROOT_IDENTIFIERS = %w(rbac_tenant_manage_quotas).freeze
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps MY_TENANT_FEATURE_ROOT_IDENTIFIERS would b a better name

@lpichler lpichler changed the title Mark rbac_tenant_manage_quotas as SELF TENANT FEATURE Mark rbac_tenant_manage_quotas as MY TENANT FEATURE Jan 4, 2019
@lpichler lpichler force-pushed the add_SELF_TENANT_FEATURE_ROOT_IDENTIFIERS branch from f3e548b to e7eb909 Compare January 4, 2019 08:11
Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@gtanzillo gtanzillo added this to the Sprint 102 Ending Jan 7, 2019 milestone Jan 4, 2019
@gtanzillo gtanzillo merged commit f57b574 into ManageIQ:master Jan 4, 2019
simaishi pushed a commit that referenced this pull request Jan 7, 2019
…IDENTIFIERS

Mark rbac_tenant_manage_quotas as  MY TENANT FEATURE

(cherry picked from commit f57b574)

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

simaishi commented Jan 7, 2019

Hammer backport details:

$ git log -1
commit 23d3b72df96a316838fbbe0f8e8150c7c85806c8
Author: Gregg Tanzillo <gtanzill@redhat.com>
Date:   Fri Jan 4 13:22:03 2019 -0500

    Merge pull request #18322 from lpichler/add_SELF_TENANT_FEATURE_ROOT_IDENTIFIERS
    
    Mark rbac_tenant_manage_quotas as  MY TENANT FEATURE
    
    (cherry picked from commit f57b574e108d48205aab53649727cb36bb009c0d)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1468795

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