Allow teachers to access internal users and manage them in their study groups
This commit is contained in:

committed by
Sebastian Serth

parent
e3018c1847
commit
0e7c38657f
@ -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
|
||||
|
Reference in New Issue
Block a user