Class ClassRole
In: app/models/class_role.rb
Parent: ActiveRecord::Base

Methods

Constants

CLASS_ROLE_INSTRUCTOR = 'instructor'
CLASS_ROLE_STUDENT = 'student'

Public Class methods

[Source]

    # File app/models/class_role.rb, line 9
 9:   def self.get_instructor
10:     return ClassRole.find_by_role(CLASS_ROLE_INSTRUCTOR)
11:   end

[Source]

    # File app/models/class_role.rb, line 13
13:   def self.get_owner
14:     return ClassRole.find_by_role(CLASS_ROLE_STUDENT)
15:   end

Public Instance methods

[Source]

    # File app/models/class_role.rb, line 17
17:   def to_label
18:     @role
19:   end

Protected Instance methods

[Source]

    # File app/models/class_role.rb, line 23
23:   def authorized_for_create?
24:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ROOT)
25:   end

[Source]

    # File app/models/class_role.rb, line 31
31:   def authorized_for_destroy?
32:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ROOT)
33:   end

[Source]

    # File app/models/class_role.rb, line 35
35:   def authorized_for_read?
36:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ROOT)
37:   end

[Source]

    # File app/models/class_role.rb, line 27
27:   def authorized_for_update?
28:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ROOT)
29:   end

[Validate]