forked from ManageIQ/manageiq-ui-classic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide "Add New Network Manager" unless Nuage is enabled
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]>
- Loading branch information
1 parent
ada1328
commit 85e559e
Showing
2 changed files
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
class ApplicationHelper::Button::EmsNetwork < ApplicationHelper::Button::Basic | ||
def visible? | ||
# Nuage is only provider that supports adding NetworkProvider manually | ||
# therefore we hide drop-down option completely unless Nuage is enabled. | ||
return ::Settings.product.nuage unless @record # add new | ||
# therefore we hide drop-down option completely unless Nuage is listed | ||
# in config/permissions.yaml. | ||
return Vmdb::PermissionStores.instance.supported_ems_type?('nuage_network') unless @record # allow add new network manager | ||
|
||
@record.supports?(:ems_network_new) # edit | ||
@record.supports?(:ems_network_new) # allow edit of existing manager | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters