Sha256: 83168eddb1d51688876e5f61581dad275c3281f249619511b3a4d4988d641f21
Contents?: true
Size: 539 Bytes
Versions: 40
Compression:
Stored size: 539 Bytes
Contents
module Scrivito class PublishAbility < Struct.new(:user, :workspace, :obj) def self.mget(user, workspace, obj_ids) objs = workspace.objs.find_including_deleted(obj_ids) obj_ids.map do |obj_id| PublishAbility.new(user, workspace, objs.find { |obj| obj.id == obj_id }) end end def as_json { restriction_messages: restriction_messages } end private def restriction_messages if obj user.restriction_messages_for(obj) else [] end end end end
Version data entries
40 entries across 40 versions & 1 rubygems