Skip to content

Commit

Permalink
Check embedded_terraform role in Button disabled?
Browse files Browse the repository at this point in the history
Prevent the user from adding credentials/repositories if the
embedded_terraform role is disabled.
  • Loading branch information
agrare committed Jun 6, 2024
1 parent 546f5ab commit 2779155
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/helpers/application_helper/button/embedded_terraform.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
class ApplicationHelper::Button::EmbeddedTerraform < ApplicationHelper::Button::Basic
def disabled?
if Rbac.filtered(ManageIQ::Providers::EmbeddedTerraform::AutomationManager.all).empty?
if !MiqRegion.my_region.role_active?('embedded_terraform')
@error_message = _("Embedded Terraform Role is not enabled.")
elsif Rbac.filtered(ManageIQ::Providers::EmbeddedTerraform::AutomationManager.all).empty?
@error_message = _("User isn't allowed to use the Embedded Terraform provider.")
end
@error_message.present?
end
end

0 comments on commit 2779155

Please sign in to comment.