Skip to content

Commit

Permalink
Merge pull request #8848 from Fryguy/prototype_workflow_routes
Browse files Browse the repository at this point in the history
Mark workflow controllers as prototype

(cherry picked from commit 0f5847a)
  • Loading branch information
DavidResende0 authored and Fryguy committed Jul 25, 2023
1 parent 2689336 commit ba759b9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/controllers/workflow_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class WorkflowController < ApplicationController
before_action :check_prototype
before_action :check_privileges
before_action :get_session_data

Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions app/controllers/workflow_repository_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class WorkflowRepositoryController < ApplicationController
before_action :check_prototype

before_action :check_privileges
before_action :get_session_data

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ba759b9

Please sign in to comment.