Class: Organization::Status::Disabled
- Inherits:
-
Base
- Object
- Base
- Organization::Status::Disabled
- Defined in:
- app/models/concerns/organization/status/disabled.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/disabled.rb', line 11 def ex_student_access_mode(user) OrganizationAccessMode::ReadOnly.new user, organization, :faqs, :profile end |
#outsider_access_mode(user) ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/models/concerns/organization/status/disabled.rb', line 15 def outsider_access_mode(user) if organization.public? OrganizationAccessMode::Gone.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/disabled.rb', line 7 def student_access_mode(user) OrganizationAccessMode::ReadOnly.new user, organization, :faqs, :profile, :exercises, :discussions end |
#teacher_access_mode(user) ⇒ Object
3 4 5 |
# File 'app/models/concerns/organization/status/disabled.rb', line 3 def teacher_access_mode(user) OrganizationAccessMode::Full.new user, organization end |
#validate_enabled! ⇒ Object
23 24 25 |
# File 'app/models/concerns/organization/status/disabled.rb', line 23 def validate_enabled! raise Mumuki::Domain::DisabledOrganizationError end |