pundit: convert saved searches to pundit.

This commit is contained in:
evazion
2020-03-20 18:03:01 -05:00
parent 415d9591c5
commit 3bb3c0b990
4 changed files with 60 additions and 34 deletions
+21
View 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