Sha256: ac25234afe48057989fe4455bb916b484a384227b9503a7f752d8ab85be1153b
Contents?: true
Size: 581 Bytes
Versions: 20
Compression:
Stored size: 581 Bytes
Contents
require 'orange-core/carton' class OrangeUser < Orange::Carton id admin do title :name text :open_id end has n, :orange_sites, :through => Resource 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 end class OrangeSite has n, :orange_users, :through => Resource end
Version data entries
20 entries across 20 versions & 2 rubygems