Allow platform admins and internal users to switch their current study group
This commit is contained in:

committed by
Sebastian Serth

parent
2e3480a068
commit
ac3dc8d30f
@ -5,8 +5,8 @@ class StudyGroupPolicy < AdminOnlyPolicy
|
||||
admin? || teacher?
|
||||
end
|
||||
|
||||
%i[show? edit? update? stream_la?].each do |action|
|
||||
define_method(action) { admin? || (@user.teacher? && @record.present? && @user.study_groups.exists?(@record.id)) }
|
||||
%i[show? edit? update? stream_la? set_as_current?].each do |action|
|
||||
define_method(action) { admin? || teacher_in_study_group? }
|
||||
end
|
||||
|
||||
def destroy?
|
||||
|
Reference in New Issue
Block a user