24 lines
329 B
Ruby
24 lines
329 B
Ruby
# frozen_string_literal: true
|
|
|
|
class SavedSearchPolicy < ApplicationPolicy
|
|
def index?
|
|
!user.is_anonymous?
|
|
end
|
|
|
|
def create?
|
|
!user.is_anonymous?
|
|
end
|
|
|
|
def update?
|
|
record.user_id == user.id
|
|
end
|
|
|
|
def labels?
|
|
index?
|
|
end
|
|
|
|
def permitted_attributes
|
|
[:query, :label_string, :disable_labels]
|
|
end
|
|
end
|