lib/fcrepo_admin/ability.rb in fcrepo_admin-0.5.5 vs lib/fcrepo_admin/ability.rb in fcrepo_admin-0.6.0
- old
+ new
@@ -1,19 +1,18 @@
module FcrepoAdmin
module Ability
extend ActiveSupport::Concern
included do
- self.ability_logic += [:fcrepo_admin_aliases]
+ self.ability_logic += [:fcrepo_admin_object_permissions]
end
- def fcrepo_admin_aliases
- alias_action :download, :to => :read
- alias_action :audit_trail, :to => :read
- alias_action :permissions, :to => :read
- alias_action :content, :to => :read
- alias_action :history, :to => :read
- alias_action :upload, :to => :update
+ def fcrepo_admin_object_permissions
+ FcrepoAdmin.object_permissions.each do |action, permission|
+ can action, ActiveFedora::Base do |obj|
+ send("test_#{permission}".to_sym, obj.pid)
+ end
+ end
end
end
end