module Scrivito class PublishAbility < Struct.new(:scrivito_user, :workspace, :obj_id) def as_json {restriction_messages: restriction_messages} end private def restriction_messages obj = workspace.objs.find_including_deleted(obj_id) scrivito_user.restriction_messages_for(obj) end end end