Sha256: 9ebb6071492dfb136d6086581a1f0589706698423495bfe08c8e61d89fc942b9

Contents?: true

Size: 641 Bytes

Versions: 3

Compression:

Stored size: 641 Bytes

Contents

class WorkflowsController < WorkflowKit::WorkflowsController
  
  # Exclude `execute` from standard `cancan` authorization,
  # since the needed authorization is checked by the method below.
  #
  skip_authorization_check :only => [:execute]

  # This override of the original execute method checks for the authorization
  # and then passes to the original method.
  #
  # If this override wouldn't be here, access would be denied on a global scale,
  # except for global admins.
  #
  def execute
    authorize! :execute, Workflow.find(params[:id])
    authorize! :manage, User.find(params[:user_id]) if params[:user_id]
    super
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
your_platform-1.0.1 app/controllers/workflows_controller.rb
your_platform-1.0.0 app/controllers/workflows_controller.rb
your_platform-0.0.2 app/controllers/workflows_controller.rb