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.
Returns the full name of this user.
# 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
# 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