Add live dashboard for teachers in the context of an exercise

This commit also adds the fundamentals for ActionCable
This commit is contained in:
Sebastian Serth
2019-02-15 09:32:53 +01:00
parent 6e03939c10
commit d63700c7db
27 changed files with 215 additions and 7 deletions

View File

@@ -3,8 +3,8 @@ class ExercisePolicy < AdminOrAuthorPolicy
admin?
end
def show?
admin? || teacher?
[:show?, :study_group_dashboard?].each do |action|
define_method(action) { admin? || teacher? }
end
[:clone?, :destroy?, :edit?, :statistics?, :update?, :feedback?].each do |action|

View File

@@ -3,8 +3,8 @@ class StudyGroupPolicy < AdminOnlyPolicy
admin? || teacher?
end
[:show?, :destroy?, :edit?, :update?].each do |action|
define_method(action) { admin? || @user.teacher? && @record.users.include?(@user) }
[:show?, :destroy?, :edit?, :update?, :stream_la?].each do |action|
define_method(action) { admin? || @user.teacher? && @record.present? && @record.users.include?(@user) }
end
class Scope < Scope