Class User
In: app/models/user.rb
Parent: ActiveRecord::Base

A User class which includes functionality from the LoginEngine::AuthenticatedUser module, and is further extended by UserEngine::AuthorizedUser.

Methods

Included Modules

LoginEngine::AuthenticatedUser UserEngine::AuthorizedUser

Public Instance methods

Returns the full name of this user.

[Source]

    # File app/models/user.rb, line 37
37:   def fullname
38:     "#{self.firstname} #{self.lastname}"
39:   end

Returns an Array of the ids of quality traces the user has access to

[Source]

    # File app/models/user.rb, line 47
47:   def get_lab_group_ids
48:     # Administrators and staff can see all bioanalyzer runs, customers
49:     # are restricted to seeing bioanalyzer runs for lab groups they belong to
50:     if(self.staff? || self.admin?)
51:       @lab_groups = LabGroup.find(:all, :order => "name ASC")
52:     else
53:       @lab_groups = self.lab_groups
54:     end
55:     
56:     # gather ids of user's lab groups
57:     lab_group_ids = Array.new
58:     for lab_group in @lab_groups
59:       lab_group_ids << lab_group.id
60:     end
61:     lab_group_ids.flatten
62:     
63:     return lab_group_ids
64:   end

Returns true if the user belongs to the Role "Facility"

[Source]

    # File app/models/user.rb, line 42
42:   def staff?
43:     self.roles.include?(Role.find(:first, :conditions => ["name = ?", "Staff"]))
44:   end

[Validate]