pundit: convert saved searches to pundit.
This commit is contained in:
21
app/policies/saved_search_policy.rb
Normal file
21
app/policies/saved_search_policy.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
class SavedSearchPolicy < ApplicationPolicy
|
||||
def index?
|
||||
user.is_member?
|
||||
end
|
||||
|
||||
def create?
|
||||
user.is_member?
|
||||
end
|
||||
|
||||
def update?
|
||||
record.user_id == user.id
|
||||
end
|
||||
|
||||
def labels?
|
||||
index?
|
||||
end
|
||||
|
||||
def permitted_attributes
|
||||
[:query, :label_string, :disable_labels]
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user