Class GuestUser
In: app/models/guest_user.rb
Parent: User

Methods

Public Class methods

[Source]

   # 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

Public Instance methods

[Source]

    # 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

[Source]

    # File app/models/guest_user.rb, line 16
16:   def able_to_edit?(section)
17:     false
18:   end

[Source]

    # File app/models/guest_user.rb, line 12
12:   def able_to_view?(page)
13:     group && !!(group.sections.include?(page.section))
14:   end

[Source]

    # File app/models/guest_user.rb, line 20
20:   def group
21:     @group ||= Group.find_by_code("guest")
22:   end

[Source]

    # File app/models/guest_user.rb, line 24
24:   def groups
25:     [group]
26:   end

[Source]

    # File app/models/guest_user.rb, line 35
35:   def save(perform_validation=true)
36:     false
37:   end

You shouldn‘t be able to save a guest user

[Source]

    # File app/models/guest_user.rb, line 29
29:   def update_attribute(name, value)
30:     false
31:   end

[Source]

    # File app/models/guest_user.rb, line 32
32:   def update_attributes(attrs={})
33:     false
34:   end

[Validate]