hydra-access-controls 10.1.0 → 10.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 227c7fcd9a6a9990741af16b0c74790bc3ea2be8
4
- data.tar.gz: cd2b439253d0f68120b99b4c15da1a9e3b79b2cf
3
+ metadata.gz: dd77cc006dc72fb8cf39eb7208e44174c3e30977
4
+ data.tar.gz: c09d582cf8381231e7ca1205cb45b3474995feb2
5
5
  SHA512:
6
- metadata.gz: 425b092455b7191fd781dd267dab81495ef33cae744403d0e13b1efc1a65e9ee200fed164757831c433b8f8d5502500ee63a8002a932cfedf2a6a9cca681bd3e
7
- data.tar.gz: de0ede421bf5fcdc13ad69010a2e0423c7e74fe4d7b0ec7405bce2d9a769a4f86dfc9f2bd6bdd8c8ec50c77a581747424a809aaa97bf456a189f5ea58364a4cd
6
+ metadata.gz: 5255b0efdca03ff5e128505584067206d6989f0d9a1f80478dd7b2336aeecb4445963d6d44cea6dd01fe4d4f2f89f21aff5c1535a865b1a9a9af86f6024414ba
7
+ data.tar.gz: 47bda39ffbddbd9a532d58561cb1ef8ebd44771cb872631dc758d332b021acc41a4bb2e752696762b8d383df0e03d6a981f0236f2b01dd0afd720dd2bca5b849
@@ -7,7 +7,7 @@ module Hydra
7
7
  included do
8
8
  belongs_to :access_control, predicate: ::ACL.accessControl, class_name: 'Hydra::AccessControl'
9
9
  before_destroy do |obj|
10
- access_control.destroy
10
+ access_control.destroy unless access_control.nil?
11
11
  end
12
12
  after_save do
13
13
  # Only force save if autosave woudn't be called normally
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
19
19
  gem.required_ruby_version = '>= 1.9.3'
20
20
 
21
21
  gem.add_dependency 'activesupport', '>= 4', '< 6'
22
- gem.add_dependency "active-fedora", '>= 10.0.0.beta1', '< 11'
22
+ gem.add_dependency "active-fedora", '>= 10.0.0', '< 12'
23
23
  gem.add_dependency 'cancancan', '~> 1.8'
24
24
  gem.add_dependency 'deprecation', '~> 1.0'
25
25
  gem.add_dependency "blacklight", '>= 5.16'
@@ -229,5 +229,9 @@ describe Hydra::AccessControls::Permissions do
229
229
  it "destroys the associated permissions" do
230
230
  expect { subject.destroy }.to change { Hydra::AccessControls::Permission.count }.by(-1)
231
231
  end
232
+
233
+ it "does not raise an exception if permissions do not exist" do
234
+ expect { Foo.new.destroy }.not_to raise_error(NoMethodError)
235
+ end
232
236
  end
233
237
  end
@@ -25,65 +25,65 @@ describe Hydra::PolicyAwareAccessControlsEnforcement do
25
25
  end
26
26
  @sample_policies = []
27
27
  # user discover
28
- policy1 = Hydra::AdminPolicy.create("test-policy1")
28
+ policy1 = Hydra::AdminPolicy.create(id: "test-policy1")
29
29
  policy1.default_permissions.create(:type=>"person", :access=>"discover", :name=>"sara_student")
30
30
  policy1.save!
31
31
 
32
32
  @sample_policies << policy1
33
33
 
34
34
  # user read
35
- policy2 = Hydra::AdminPolicy.create("test-policy2")
35
+ policy2 = Hydra::AdminPolicy.create(id: "test-policy2")
36
36
  policy2.default_permissions.create(:type=>"person", :access=>"read", :name=>"sara_student")
37
37
  policy2.save!
38
38
  @sample_policies << policy2
39
39
 
40
40
  # user edit
41
- policy3 = Hydra::AdminPolicy.create("test-policy3")
41
+ policy3 = Hydra::AdminPolicy.create(id: "test-policy3")
42
42
  policy3.default_permissions.create(:type=>"person", :access=>"edit", :name=>"sara_student")
43
43
  policy3.save!
44
44
  @sample_policies << policy3
45
45
 
46
46
 
47
47
  # group discover
48
- policy4 = Hydra::AdminPolicy.create("test-policy4")
48
+ policy4 = Hydra::AdminPolicy.create(id: "test-policy4")
49
49
  policy4.default_permissions.create(:type=>"group", :access=>"discover", :name=>"africana-104-students")
50
50
  policy4.save!
51
51
  @sample_policies << policy4
52
52
 
53
53
  # group read
54
- policy5 = Hydra::AdminPolicy.create("test-policy5")
54
+ policy5 = Hydra::AdminPolicy.create(id: "test-policy5")
55
55
  policy5.default_permissions.create(:type=>"group", :access=>"read", :name=>"africana-104-students")
56
56
  policy5.save!
57
57
  @sample_policies << policy5
58
58
 
59
59
  # group edit
60
- policy6 = Hydra::AdminPolicy.create("test-policy6")
60
+ policy6 = Hydra::AdminPolicy.create(id: "test-policy6")
61
61
  policy6.default_permissions.create(:type=>"group", :access=>"edit", :name=>"africana-104-students")
62
62
  policy6.save!
63
63
  @sample_policies << policy6
64
64
 
65
65
  # public discover
66
- policy7 = Hydra::AdminPolicy.create("test-policy7")
66
+ policy7 = Hydra::AdminPolicy.create(id: "test-policy7")
67
67
  policy7.default_permissions.create(:type=>"group", :access=>"discover", :name=>"public")
68
68
  policy7.save!
69
69
  @sample_policies << policy7
70
70
 
71
71
  # public read
72
- policy8 = Hydra::AdminPolicy.create("test-policy8")
72
+ policy8 = Hydra::AdminPolicy.create(id: "test-policy8")
73
73
  policy8.default_permissions.create(:type=>"group", :access=>"read", :name=>"public")
74
74
  policy8.save!
75
75
  @sample_policies << policy8
76
76
 
77
77
  # user discover policies for testing that all are applied when over 10 are applicable
78
78
  (9..11).each do |i|
79
- policy = Hydra::AdminPolicy.create("test-policy#{i}")
79
+ policy = Hydra::AdminPolicy.create(id: "test-policy#{i}")
80
80
  policy.default_permissions.create(:type=>"person", :access=>"discover", :name=>"sara_student")
81
81
  policy.save!
82
82
  @sample_policies << policy
83
83
  end
84
84
 
85
85
  # no access
86
- policy_no_access = Hydra::AdminPolicy.new("test-policy_no_access")
86
+ policy_no_access = Hydra::AdminPolicy.new(id: "test-policy_no_access")
87
87
  policy_no_access.save!
88
88
 
89
89
  @sample_policies << policy_no_access
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.1.0
4
+ version: 10.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-08-08 00:00:00.000000000 Z
13
+ date: 2016-08-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -38,20 +38,20 @@ dependencies:
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: 10.0.0.beta1
41
+ version: 10.0.0
42
42
  - - "<"
43
43
  - !ruby/object:Gem::Version
44
- version: '11'
44
+ version: '12'
45
45
  type: :runtime
46
46
  prerelease: false
47
47
  version_requirements: !ruby/object:Gem::Requirement
48
48
  requirements:
49
49
  - - ">="
50
50
  - !ruby/object:Gem::Version
51
- version: 10.0.0.beta1
51
+ version: 10.0.0
52
52
  - - "<"
53
53
  - !ruby/object:Gem::Version
54
- version: '11'
54
+ version: '12'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: cancancan
57
57
  requirement: !ruby/object:Gem::Requirement