From 27d2e9bba75d1b33747d1fe06d003cf21132484b Mon Sep 17 00:00:00 2001 From: Jason Frey Date: Wed, 21 Jun 2023 09:49:05 -0400 Subject: [PATCH] Mark workflow controllers as prototype --- app/controllers/workflow_controller.rb | 8 ++++++++ app/controllers/workflow_repository_controller.rb | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/app/controllers/workflow_controller.rb b/app/controllers/workflow_controller.rb index 4e2939be240..aefba657532 100644 --- a/app/controllers/workflow_controller.rb +++ b/app/controllers/workflow_controller.rb @@ -1,4 +1,5 @@ class WorkflowController < ApplicationController + before_action :check_prototype before_action :check_privileges before_action :get_session_data @@ -57,6 +58,13 @@ def tag_edit_form_field_changed private + def check_prototype + return if Settings.prototype.ems_workflows.enabled + + log_privileges(false, "Workflows are not enabled. The user is not authorized for this task or item.") + raise MiqException::RbacPrivilegeException, _('The user is not authorized for this task or item.') + end + def textual_group_list [%i[properties relationships smart_management]] end diff --git a/app/controllers/workflow_repository_controller.rb b/app/controllers/workflow_repository_controller.rb index 8bafa06e099..9da0556a086 100644 --- a/app/controllers/workflow_repository_controller.rb +++ b/app/controllers/workflow_repository_controller.rb @@ -1,4 +1,6 @@ class WorkflowRepositoryController < ApplicationController + before_action :check_prototype + before_action :check_privileges before_action :get_session_data @@ -32,6 +34,13 @@ def show private + def check_prototype + return if Settings.prototype.ems_workflows.enabled + + log_privileges(false, "Workflows are not enabled. The user is not authorized for this task or item.") + raise MiqException::RbacPrivilegeException, _('The user is not authorized for this task or item.') + end + def textual_group_list [%i[properties relationships options smart_management]] end