Sha256: 1db1ff676638c5cb9cb53f6a20f64eb1fb623979df76cc0c7e1218ba180f6272

Contents?: true

Size: 651 Bytes

Versions: 35

Compression:

Stored size: 651 Bytes

Contents

module Ddr
  module Models
    module AccessControllable
      extend ActiveSupport::Concern
      extend Deprecation

      included do
        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
      deprecation_deprecate :set_initial_permissions

      def copy_permissions_from(other)
        self.permissions_attributes = other.permissions.collect { |p| p.to_hash }
      end
      deprecation_deprecate :copy_permissions_from
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
ddr-models-2.4.8 lib/ddr/models/access_controllable.rb
ddr-models-2.4.7 lib/ddr/models/access_controllable.rb
ddr-models-2.4.6 lib/ddr/models/access_controllable.rb
ddr-models-2.4.5 lib/ddr/models/access_controllable.rb
ddr-models-2.4.4 lib/ddr/models/access_controllable.rb
ddr-models-2.4.3 lib/ddr/models/access_controllable.rb
ddr-models-2.4.2 lib/ddr/models/access_controllable.rb
ddr-models-2.4.1 lib/ddr/models/access_controllable.rb
ddr-models-2.4.0 lib/ddr/models/access_controllable.rb
ddr-models-2.4.0.rc6 lib/ddr/models/access_controllable.rb
ddr-models-2.4.0.rc5 lib/ddr/models/access_controllable.rb
ddr-models-2.4.0.rc4 lib/ddr/models/access_controllable.rb
ddr-models-2.4.0.rc3 lib/ddr/models/access_controllable.rb
ddr-models-2.4.0.rc2 lib/ddr/models/access_controllable.rb
ddr-models-2.4.0.rc1 lib/ddr/models/access_controllable.rb