Module: Hippo::Concerns::ApiAttributeAccess::AccessChecks

Included in:
ClassMethods
Defined in:
lib/hippo/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)


29
30
31
# File 'lib/hippo/concerns/set_attribute_data.rb', line 29

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)


17
18
19
# File 'lib/hippo/concerns/set_attribute_data.rb', line 17

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)


23
24
25
# File 'lib/hippo/concerns/set_attribute_data.rb', line 23

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