class BaseContext

Attributes

current_user[RW]
params[RW]
project[RW]

Public Class Methods

new(project, user, params) click to toggle source
# File app/contexts/base_context.rb, line 4
def initialize(project, user, params)
  @project, @current_user, @params = project, user, params.dup
end

Public Instance Methods

abilities() click to toggle source
# File app/contexts/base_context.rb, line 8
def abilities
  @abilities ||= begin
                   abilities = Six.new
                   abilities << Ability
                   abilities
                 end
end
can?(object, action, subject) click to toggle source
# File app/contexts/base_context.rb, line 16
def can?(object, action, subject)
  abilities.allowed?(object, action, subject)
end