mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-03 06:59:14 +00:00
13 lines
369 B
Ruby
13 lines
369 B
Ruby
class Api::Admin::IndexEnterpriseSerializer < ActiveModel::Serializer
|
|
attributes :name, :id, :permalink, :is_primary_producer, :sells, :producer_profile_only, :owned, :edit_path
|
|
|
|
def owned
|
|
return true if options[:spree_current_user].admin?
|
|
object.owner == options[:spree_current_user]
|
|
end
|
|
|
|
def edit_path
|
|
edit_admin_enterprise_path(object)
|
|
end
|
|
end
|