Class | GuestUser |
In: |
app/models/guest_user.rb
|
Parent: | User |
# File app/models/guest_user.rb, line 3 3: def initialize(attributes={}) 4: super({:login => "guest", :first_name => "Anonymous", :last_name => "User"}.merge(attributes)) 5: @guest = true 6: end
# File app/models/guest_user.rb, line 8 8: def able_to?(*name) 9: group && group.permissions.count(:conditions => ["name in (?)", name.map(&:to_s)]) > 0 10: end
# File app/models/guest_user.rb, line 12 12: def able_to_view?(page) 13: group && !!(group.sections.include?(page.section)) 14: end
# File app/models/guest_user.rb, line 20 20: def group 21: @group ||= Group.find_by_code("guest") 22: end