Class: OrangeUser

Inherits:
Orange::Carton show all
Defined in:
lib/orange-more/administration/cartons/user.rb

Constant Summary

Constants inherited from Orange::Carton

Orange::Carton::SCAFFOLD_OPTIONS

Instance Method Summary collapse

Methods inherited from Orange::Carton

add_scaffold, admin, admin_property, as_resource, asset, boolean, date, datetime, expose, form_props, front, front_property, fulltext, id, init, orange, orange_property, scaffold_property, string, text, time, title, #to_s

Methods included from ClassInheritableAttributes

#cattr_accessor, #cattr_reader, #cattr_writer, eval_in_accessor_module, fetch_value, store_value

Instance Method Details

#allowed?(packet) ⇒ Boolean



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/orange-more/administration/cartons/user.rb', line 12

def allowed?(packet)
  subsite_access = packet['subsite'].blank? ? false : self.orange_sites.first(:id => packet['subsite'].id)
  site_access = self.orange_sites.first(:id => packet['site'].id)
  if(!site_access.blank?)
    true
  elsif !packet['subsite'].blank? && subsite_access
    true
  else
    false
  end
end