Sha256: 240d5c907c9a9a129efedca6df44447563b517e0c6f9682fa3135f706f85344e

Contents?: true

Size: 427 Bytes

Versions: 7

Compression:

Stored size: 427 Bytes

Contents

require 'cancan'

module FcrepoAdmin
  module DatastreamAbility
    extend ActiveSupport::Concern
    
    included do
      self.ability_logic += [:datastream_permissions]
    end

    def datastream_permissions
      can :read, ActiveFedora::Datastream do |ds|
        test_read(ds.pid)
      end 

      can [:edit, :update, :destroy], ActiveFedora::Datastream do |ds|
        test_edit(ds.pid)
      end
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fcrepo_admin-0.3.5 lib/fcrepo_admin/datastream_ability.rb
fcrepo_admin-0.3.4 lib/fcrepo_admin/datastream_ability.rb
fcrepo_admin-0.3.3 lib/fcrepo_admin/datastream_ability.rb
fcrepo_admin-0.3.2 lib/fcrepo_admin/datastream_ability.rb
fcrepo_admin-0.3.1 lib/fcrepo_admin/datastream_ability.rb
fcrepo_admin-0.3.0 lib/fcrepo_admin/datastream_ability.rb
fcrepo_admin-0.2.4 lib/fcrepo_admin/datastream_ability.rb