Merge pull request #134 from openHPI/user_exercise_feedback_backend

User exercise feedback backend UI
This commit is contained in:
rteusner
2017-11-15 14:19:04 +01:00
committed by GitHub
14 changed files with 182 additions and 29 deletions

View File

@@ -1,8 +1,4 @@
class UserExerciseFeedbackPolicy < ApplicationPolicy
def author?
@user == @record.author
end
private :author?
class UserExerciseFeedbackPolicy < AdminOrAuthorPolicy
def create?
everyone
@@ -12,8 +8,4 @@ class UserExerciseFeedbackPolicy < ApplicationPolicy
everyone
end
[:show? ,:destroy?, :edit?, :update?].each do |action|
define_method(action) { admin? || author?}
end
end