Implement index action. Repair destroy
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user