Allow teachers to access internal users and manage them in their study groups

This commit is contained in:
Sebastian Serth
2022-09-22 17:55:10 +02:00
committed by Sebastian Serth
parent e3018c1847
commit 0e7c38657f
11 changed files with 45 additions and 22 deletions

View File

@ -2,10 +2,14 @@
class InternalUserPolicy < AdminOnlyPolicy
def destroy?
super && !@record.admin?
admin? && !@record.admin?
end
def index?
admin? || teacher?
end
def show?
super || @record == @user
admin? || @record == @user || teacher_in_study_group?
end
end