Sha256: 745584d661c3ded74ca5ccf9e0181dc0bb6382d2280f5d6f58238833e6e7dee9

Contents?: true

Size: 672 Bytes

Versions: 9

Compression:

Stored size: 672 Bytes

Contents

module Ddr
  module Models
    module AccessControllable
      extend ActiveSupport::Concern

      included do
        # adds methods for managing Hydra rightsMetadata content
        include Hydra::AccessControls::Permissions unless include? Hydra::AccessControls::Permissions
      end

      def set_initial_permissions(user_creator = nil)
        if user_creator
          self.permissions_attributes = [{type: "user", access: "edit", name: user_creator.to_s}]
        end
      end

      def copy_permissions_from(other)
        # XXX active-fedora < 7.0
        self.permissions_attributes = other.permissions.collect { |p| p.to_hash }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ddr-models-1.17.1 lib/ddr/models/access_controllable.rb
ddr-models-1.17.0 lib/ddr/models/access_controllable.rb
ddr-models-1.16.2 lib/ddr/models/access_controllable.rb
ddr-models-1.16.1 lib/ddr/models/access_controllable.rb
ddr-models-1.16.0 lib/ddr/models/access_controllable.rb
ddr-models-1.15.0 lib/ddr/models/access_controllable.rb
ddr-models-1.14.2 lib/ddr/models/access_controllable.rb
ddr-models-1.14.1 lib/ddr/models/access_controllable.rb
ddr-models-1.14.0 lib/ddr/models/access_controllable.rb