Fix tests and slightly refactor some policies

This commit is contained in:
Sebastian Serth
2018-11-30 15:44:45 +01:00
parent 2125fb1c1d
commit 3665058435
14 changed files with 19 additions and 64 deletions

View File

@@ -20,7 +20,7 @@ class ProxyExercisePolicy < AdminOrAuthorPolicy
if @user.admin?
@scope.all
elsif @user.teacher?
@scope.where('user_id = ?', @user.id)
@scope.where('user_id = ? OR public = TRUE', @user.id)
else
@scope.none
end