Module: Lanes::Concerns::ApiAttributeAccess::AccessChecks

Included in:
ClassMethods
Defined in:
lib/lanes/concerns/set_attribute_data.rb

Instance Method Summary collapse

Instance Method Details

#can_delete_attributes?(params, user) ⇒ Boolean

Can the API delete the model? This check is performed before we bother checking each attribute individually

Returns:

  • (Boolean)


28
29
30
# File 'lib/lanes/concerns/set_attribute_data.rb', line 28

def can_delete_attributes?(params, user)
    return user.can_delete?(self, params)
end

#can_read_attributes?(params, user) ⇒ Boolean

Can the API read data from the model?

Returns:

  • (Boolean)


16
17
18
# File 'lib/lanes/concerns/set_attribute_data.rb', line 16

def can_read_attributes?(params, user)
    return user.can_read?(self, params)
end

#can_write_attributes?(params, user) ⇒ Boolean

Can the API write data to the model? This check is performed before we bother checking each attribute individually

Returns:

  • (Boolean)


22
23
24
# File 'lib/lanes/concerns/set_attribute_data.rb', line 22

def can_write_attributes?(params, user)
    return user.can_write?(self, params)
end