hydra-access-controls 10.0.0.beta1 → 10.0.0.beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e70730aa7b919d1cbf3e4815db314bdf6c7ab61b
4
- data.tar.gz: be22eb4d9e206a741b8e7543d355bcec3a9342dd
3
+ metadata.gz: 9665cf60571d6ee1e75abbdbc49e6901685a6ad1
4
+ data.tar.gz: 14e7ee3c6bc5459a4e511ae4db987f91cd24dc2b
5
5
  SHA512:
6
- metadata.gz: ebeb634bda7b08ac09e6a4210c87ba55863a6d63ad7d6abe9b6d31f8fd8d313bcd916494f2c5f9f3b50fea52012141b2caf5201593043747dbe451dc0d3b94b3
7
- data.tar.gz: f13e52899116432172f7bcf87d53b55abf1173c294a70c4c66b28037339807297305ca54b8b1b948bb6ef6cccb57e347b48188e2c85c987bc5ec8b231cbe067b
6
+ metadata.gz: 9476ae7eceb9e244213a74226214e5af0e3a86060b58d90fef84c4e739b7bd9b36edaa4d94065787e5639e1c6e4fa55397636182e56e6ac4a6f5cebea51d7235
7
+ data.tar.gz: da20d7a1b237040d0efc5ebe266e1f839bd810c4f75ed107595aa88d7de0ac33af0613751b74ab26e1bd3655bd21a72daad4c494d8e669cadbe4558cedfc0fa6
@@ -34,10 +34,6 @@ module Hydra
34
34
  end
35
35
  end
36
36
 
37
- # def has_destroy_flag?(hash)
38
- # ActiveFedora::Type::Boolean.new.cast(hash['_destroy'])
39
- # end
40
-
41
37
  def relationship
42
38
  @relationship ||= CollectionRelationship.new(self, :contains)
43
39
  end
@@ -49,7 +45,7 @@ module Hydra
49
45
  end
50
46
 
51
47
  delegate :to_a, :to_ary, :map, :delete, :last, :size, :count, :[],
52
- :==, :detect, to: :@relationship
48
+ :==, :detect, :empty?, to: :@relationship
53
49
 
54
50
  # TODO: if directly_contained relationships supported find, we could just
55
51
  # delegate find.
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe Hydra::AccessControl::CollectionRelationship do
4
+ let(:access_control) { Hydra::AccessControl.new }
5
+ let(:relationship) { access_control.relationship }
6
+
7
+ describe "#==" do
8
+ subject { relationship }
9
+ it "compares to array" do
10
+ expect(subject).to eq []
11
+ end
12
+ end
13
+
14
+ describe "#empty?" do
15
+ subject { relationship.empty? }
16
+ it { is_expected.to be true }
17
+ end
18
+ end
@@ -7,14 +7,14 @@ describe Hydra::AccessControls::Permissions do
7
7
  end
8
8
  end
9
9
 
10
- subject { Foo.new }
10
+ let(:model) { Foo.new }
11
+ subject { model }
11
12
 
12
- it "has many permissions" do
13
- expect(subject.permissions).to eq []
13
+ describe "#permisisons" do
14
+ subject { model.permissions }
15
+ it { is_expected.to be_kind_of Hydra::AccessControl::CollectionRelationship }
14
16
  end
15
17
 
16
- #TODO is permission same as an acl?
17
-
18
18
  it "has a set of permissions" do
19
19
  subject.read_groups=['group1', 'group2']
20
20
  subject.edit_users=['user1']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-access-controls
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.0.beta1
4
+ version: 10.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -196,6 +196,7 @@ files:
196
196
  - spec/unit/access_right_spec.rb
197
197
  - spec/unit/accessible_by_spec.rb
198
198
  - spec/unit/admin_policy_spec.rb
199
+ - spec/unit/collection_relationship_spec.rb
199
200
  - spec/unit/config_spec.rb
200
201
  - spec/unit/embargoable_spec.rb
201
202
  - spec/unit/ip_base_ability_spec.rb
@@ -249,6 +250,7 @@ test_files:
249
250
  - spec/unit/access_right_spec.rb
250
251
  - spec/unit/accessible_by_spec.rb
251
252
  - spec/unit/admin_policy_spec.rb
253
+ - spec/unit/collection_relationship_spec.rb
252
254
  - spec/unit/config_spec.rb
253
255
  - spec/unit/embargoable_spec.rb
254
256
  - spec/unit/ip_base_ability_spec.rb