Fix rubocop offenses
This commit is contained in:
@ -6,7 +6,7 @@ class ExercisePolicy < AdminOrAuthorPolicy
|
||||
end
|
||||
|
||||
%i[show? feedback? statistics? rfcs_for_exercise?].each do |action|
|
||||
define_method(action) { admin? || teacher_in_study_group? || teacher? && @record.public? || author? }
|
||||
define_method(action) { admin? || teacher_in_study_group? || (teacher? && @record.public?) || author? }
|
||||
end
|
||||
|
||||
def study_group_dashboard?
|
||||
|
@ -6,7 +6,7 @@ class ProxyExercisePolicy < AdminOrAuthorPolicy
|
||||
end
|
||||
|
||||
def show?
|
||||
admin? || teacher_in_study_group? || teacher? && @record.public? || author?
|
||||
admin? || teacher_in_study_group? || (teacher? && @record.public?) || author?
|
||||
end
|
||||
|
||||
%i[clone? destroy? edit? update?].each do |action|
|
||||
|
@ -6,7 +6,7 @@ class StudyGroupPolicy < AdminOnlyPolicy
|
||||
end
|
||||
|
||||
%i[show? destroy? edit? update? stream_la?].each do |action|
|
||||
define_method(action) { admin? || @user.teacher? && @record.present? && @user.study_groups.exists?(@record.id) }
|
||||
define_method(action) { admin? || (@user.teacher? && @record.present? && @user.study_groups.exists?(@record.id)) }
|
||||
end
|
||||
|
||||
class Scope < Scope
|
||||
|
Reference in New Issue
Block a user