Class: Organization::Status::Enabled
- Inherits:
-
Base
- Object
- Base
- Organization::Status::Enabled
- Defined in:
- app/models/concerns/organization/status/enabled.rb
Instance Method Summary collapse
- #ex_student_access_mode(user) ⇒ Object
- #outsider_access_mode(user) ⇒ Object
- #student_access_mode(user) ⇒ Object
- #teacher_access_mode(user) ⇒ Object
- #validate_enabled! ⇒ Object
Instance Method Details
#ex_student_access_mode(user) ⇒ Object
11 12 13 |
# File 'app/models/concerns/organization/status/enabled.rb', line 11 def ex_student_access_mode(user) OrganizationAccessMode::ReadOnly.new user, organization, :faqs, :profile, :discussions, exercises: :submitted end |
#outsider_access_mode(user) ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/models/concerns/organization/status/enabled.rb', line 15 def outsider_access_mode(user) if organization.public? OrganizationAccessMode::Full.new user, organization else OrganizationAccessMode::Forbidden.new user, organization end end |
#student_access_mode(user) ⇒ Object
7 8 9 |
# File 'app/models/concerns/organization/status/enabled.rb', line 7 def student_access_mode(user) OrganizationAccessMode::Full.new user, organization end |
#teacher_access_mode(user) ⇒ Object
3 4 5 |
# File 'app/models/concerns/organization/status/enabled.rb', line 3 def teacher_access_mode(user) OrganizationAccessMode::Full.new user, organization end |
#validate_enabled! ⇒ Object
23 24 |
# File 'app/models/concerns/organization/status/enabled.rb', line 23 def validate_enabled! end |