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

Hide "Add New Network Manager" unless Nuage is enabled #3979

Merged
merged 1 commit into from
Jun 7, 2018

Conversation

miha-plesko
Copy link
Contributor

Nuage is somewhat special in a way it allows adding NetworkManager directly, without CloudManager. For all other providers such behavior is not feasible, therefore "Add New Network Manager" button should be hidden.

capture

With this commit we make sure that the button is hidden unless config/permissions.yaml file contains entry allowing user to use Nuage provider:

- ems-type:nuage_network

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1577888

@miq-bot add_label enhancement,gaprindashvili/yes
@miq-bot assign @blomquisg

/cc @djberg96

@miha-plesko
Copy link
Contributor Author

@djberg96 apologies for the troubles because we didn't think of this scenario when we flipped product: nuage to true.

Nuage is somewhat special in a way it allows adding NetworkManager
directly, without CloudManager. For all other providers such behavior
is not feasible, therefore "Add New Network Manager" button should be
hidden.

With this commit we make sure that the button is hidden unless
config/permissions.yaml file contains entry allowing user to use
Nuage provider:

```
- ems-type:nuage_network
```

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1577888

Signed-off-by: Miha Pleško <[email protected]>
@miha-plesko miha-plesko force-pushed the nuage-disable-button branch from ebde790 to 85e559e Compare May 23, 2018 07:55
@miq-bot
Copy link
Member

miq-bot commented May 23, 2018

Checked commit miha-plesko@85e559e with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🏆

@djberg96
Copy link
Contributor

Won't this always return true by default as well? Or are users expected to remove it?

# On my local rails console:
irb(main):001:0> Vmdb::PermissionStores.instance.supported_ems_type?('nuage_network')
=> true

@miha-plesko
Copy link
Contributor Author

miha-plesko commented May 23, 2018

It's the other way around: by default the config/permissions.yaml is very modest in CFME appliances. User then needs to manually enable additional providers e.g. Nuage provider. MIQ appliances, however, contain no config/permissions.yaml file at all and therefore return true for all permissions. So if you're on MIQ appliance, also this will yield true:

Vmdb::PermissionStores.instance.supported_ems_type?('blah blah blah')

(unless you add permissions.yaml on your own)

😄

@djberg96
Copy link
Contributor

👍

@miha-plesko
Copy link
Contributor Author

@blomquisg @juliancheal would you agree that UI should check config/permissions.yaml in order to decide whether "Add a New Network Provider" button is to be visible?

@juliancheal
Copy link
Member

👍 LGTM

@mzazrivec mzazrivec added the bug label May 28, 2018
@mzazrivec mzazrivec assigned mzazrivec and unassigned blomquisg Jun 7, 2018
@mzazrivec mzazrivec added this to the Sprint 88 Ending Jun 18, 2018 milestone Jun 7, 2018
@mzazrivec mzazrivec merged commit f267477 into ManageIQ:master Jun 7, 2018
@miha-plesko miha-plesko deleted the nuage-disable-button branch January 7, 2019 08:24
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.

6 participants