Sha256: 9cfda44eabdf13ea35bdf7ffd85980bb72a7b376b5773ef589619319fde5c425

Contents?: true

Size: 333 Bytes

Versions: 10

Compression:

Stored size: 333 Bytes

Contents

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
scrivito_sdk-1.7.0 lib/scrivito/publish_ability.rb
scrivito_sdk-1.7.0.rc2 lib/scrivito/publish_ability.rb
scrivito_sdk-1.6.1 lib/scrivito/publish_ability.rb
scrivito_sdk-1.6.1.rc1 lib/scrivito/publish_ability.rb
scrivito_sdk-1.7.0.rc1 lib/scrivito/publish_ability.rb
scrivito_sdk-1.6.0 lib/scrivito/publish_ability.rb
scrivito_sdk-1.6.0.rc5 lib/scrivito/publish_ability.rb
scrivito_sdk-1.6.0.rc4 lib/scrivito/publish_ability.rb
scrivito_sdk-1.6.0.rc3 lib/scrivito/publish_ability.rb
scrivito_sdk-1.6.0.rc2 lib/scrivito/publish_ability.rb