fcrepo_admin 0.3.5 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/HISTORY.rdoc +6 -0
- data/README.rdoc +42 -20
- data/app/controllers/fcrepo_admin/associations_controller.rb +7 -0
- data/app/controllers/fcrepo_admin/objects_controller.rb +2 -1
- data/app/helpers/fcrepo_admin/associations_helper.rb +5 -0
- data/app/views/fcrepo_admin/associations/_associations.html.erb +26 -0
- data/app/views/fcrepo_admin/associations/index.html.erb +1 -0
- data/app/views/fcrepo_admin/associations/show.html.erb +11 -0
- data/app/views/fcrepo_admin/catalog/_document.html.erb +6 -0
- data/app/views/fcrepo_admin/datastreams/_content.html.erb +4 -3
- data/app/views/fcrepo_admin/datastreams/_context_nav.html.erb +9 -0
- data/app/views/fcrepo_admin/datastreams/_context_nav_items.html.erb +21 -0
- data/app/views/fcrepo_admin/datastreams/{_datastreams.html → _datastreams.html.erb} +16 -3
- data/app/views/fcrepo_admin/datastreams/_profile.html.erb +9 -10
- data/app/views/fcrepo_admin/datastreams/content.html.erb +1 -0
- data/app/views/fcrepo_admin/datastreams/index.html.erb +1 -4
- data/app/views/fcrepo_admin/datastreams/show.html.erb +1 -14
- data/app/views/fcrepo_admin/objects/_context_nav.html.erb +9 -0
- data/app/views/fcrepo_admin/objects/_context_nav_datastreams.html.erb +13 -0
- data/app/views/fcrepo_admin/objects/_context_nav_items.html.erb +19 -0
- data/app/views/fcrepo_admin/objects/_direct_permissions.html.erb +8 -0
- data/app/views/fcrepo_admin/objects/_inherited_permissions.html.erb +23 -0
- data/app/views/fcrepo_admin/objects/_permissions_list.html.erb +18 -0
- data/app/views/fcrepo_admin/objects/{_permissions_row.html.erb → _permissions_list_item.html.erb} +0 -0
- data/app/views/fcrepo_admin/objects/_properties.html.erb +6 -5
- data/app/views/fcrepo_admin/objects/permissions.html.erb +5 -0
- data/app/views/fcrepo_admin/objects/show.html.erb +3 -46
- data/app/views/layouts/fcrepo_admin/datastreams.html.erb +2 -2
- data/app/views/layouts/fcrepo_admin/objects.html.erb +1 -1
- data/config/locales/fcrepo_admin.en.yml +24 -4
- data/config/routes.rb +7 -2
- data/lib/fcrepo_admin.rb +4 -1
- data/lib/fcrepo_admin/ability.rb +18 -0
- data/lib/fcrepo_admin/controller/associations_controller_behavior.rb +49 -0
- data/lib/fcrepo_admin/controller/catalog_controller_behavior.rb +9 -0
- data/lib/fcrepo_admin/controller/controller_behavior.rb +49 -0
- data/lib/fcrepo_admin/controller/datastreams_controller_behavior.rb +21 -28
- data/lib/fcrepo_admin/controller/objects_controller_behavior.rb +7 -32
- data/lib/fcrepo_admin/helpers/associations_helper_behavior.rb +23 -0
- data/lib/fcrepo_admin/helpers/datastreams_helper_behavior.rb +7 -10
- data/lib/fcrepo_admin/helpers/fcrepo_admin_helper_behavior.rb +5 -10
- data/lib/fcrepo_admin/helpers/objects_helper_behavior.rb +0 -36
- data/lib/fcrepo_admin/version.rb +1 -1
- data/spec/controllers/associations_controller_spec.rb +34 -0
- data/spec/controllers/datastreams_controller_spec.rb +14 -12
- data/spec/controllers/objects_controller_spec.rb +6 -6
- data/spec/factories/fcrepo_admin_factories.rb +10 -6
- data/spec/features/associations/index.html.erb_spec.rb +28 -0
- data/spec/features/datastreams/edit.html.erb_spec.rb +1 -1
- data/spec/features/datastreams/index.html.erb_spec.rb +12 -0
- data/spec/features/datastreams/show.html.erb_spec.rb +1 -1
- data/spec/features/datastreams/upload.html.erb_spec.rb +1 -1
- data/spec/features/objects/audit_trail.html.erb_spec.rb +1 -1
- data/spec/features/objects/permissions.html.erb_spec.rb +19 -0
- data/spec/features/objects/show.html.erb_spec.rb +7 -30
- data/spec/internal/app/models/ability.rb +1 -1
- data/spec/internal/app/models/admin_policy.rb +3 -0
- data/spec/internal/app/models/collection.rb +14 -0
- data/spec/internal/app/models/item.rb +15 -0
- data/spec/internal/app/models/{content_model.rb → part.rb} +2 -1
- metadata +65 -73
- data/app/views/fcrepo_admin/datastreams/_datastream_nav.html.erb +0 -18
- data/app/views/fcrepo_admin/objects/_more_info.html.erb +0 -6
- data/app/views/fcrepo_admin/objects/_permissions.html.erb +0 -12
- data/app/views/fcrepo_admin/objects/_permissions_header.html.erb +0 -7
- data/lib/fcrepo_admin/datastream_ability.rb +0 -22
@@ -1,12 +0,0 @@
|
|
1
|
-
<% if permissions.empty? %>
|
2
|
-
<p>
|
3
|
-
<%= t("fcrepo_admin.object.permissions.no_permissions") %>
|
4
|
-
</p>
|
5
|
-
<% else %>
|
6
|
-
<table class="table table-bordered table-condensed">
|
7
|
-
<%= render :partial => "permissions_header" %>
|
8
|
-
<tbody>
|
9
|
-
<%= render :partial => "permissions_row", :collection => permissions, :as => :permission %>
|
10
|
-
</tbody>
|
11
|
-
</table>
|
12
|
-
<% end %>
|
@@ -1,7 +0,0 @@
|
|
1
|
-
<thead>
|
2
|
-
<tr>
|
3
|
-
<th scope="col"><%= t("fcrepo_admin.object.permissions.header.type") %></th>
|
4
|
-
<th scope="col"><%= t("fcrepo_admin.object.permissions.header.name") %></th>
|
5
|
-
<th scope="col"><%= t("fcrepo_admin.object.permissions.header.access") %></th>
|
6
|
-
</tr>
|
7
|
-
</thead>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'cancan'
|
2
|
-
|
3
|
-
module FcrepoAdmin
|
4
|
-
module DatastreamAbility
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
|
7
|
-
included do
|
8
|
-
self.ability_logic += [:datastream_permissions]
|
9
|
-
end
|
10
|
-
|
11
|
-
def datastream_permissions
|
12
|
-
can :read, ActiveFedora::Datastream do |ds|
|
13
|
-
test_read(ds.pid)
|
14
|
-
end
|
15
|
-
|
16
|
-
can [:edit, :update, :destroy], ActiveFedora::Datastream do |ds|
|
17
|
-
test_edit(ds.pid)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
end
|