Sha256: b8cc0317ba5d938e0812a08c0438ee1cbe8f1a9b68daa0eb16e7f0e909cdc9c8

Contents?: true

Size: 713 Bytes

Versions: 9

Compression:

Stored size: 713 Bytes

Contents

# frozen_string_literal: true

module RailsWorkflow
  # Default class to describe User operation.
  # It describes two main differences of user
  # operation - that it can't start automaticaly
  # (only user can start it) and that it can be
  # assigned to any user. This way this class can be
  # used later as base class. There is two examples:
  # UserByGroupOperation - where user groups used to
  # split permissions to complete operations
  # and UserByRoleOperation where user roles used to
  # split permissions to complete operations.
  class UserOperation < Operation
    def can_start?
      false
    end

    def can_be_assigned?(_user)
      true # any user can complete operation
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails_workflow-0.7.3 app/models/rails_workflow/user_operation.rb
rails_workflow-0.7.2 app/models/rails_workflow/user_operation.rb
rails_workflow-0.7.1 app/models/rails_workflow/user_operation.rb
rails_workflow-0.7.0 app/models/rails_workflow/user_operation.rb
rails_workflow-0.4.4 app/models/rails_workflow/user_operation.rb
rails_workflow-0.4.3 app/models/rails_workflow/user_operation.rb
rails_workflow-0.4.2 app/models/rails_workflow/user_operation.rb
rails_workflow-0.4.1 app/models/rails_workflow/user_operation.rb
rails_workflow-0.4.0 app/models/rails_workflow/user_operation.rb