hydra-access-controls 6.3.2 → 6.3.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -107,7 +107,9 @@ module Hydra
|
|
107
107
|
end
|
108
108
|
else
|
109
109
|
remove_all_permissions(selector)
|
110
|
-
|
110
|
+
if new_access_level == "none"
|
111
|
+
self.content = self.to_xml
|
112
|
+
else
|
111
113
|
access_type_symbol = "#{new_access_level}_access".to_sym
|
112
114
|
current_values = term_values(access_type_symbol, type)
|
113
115
|
self.update_values([access_type_symbol, type] => current_values + [actor] )
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hydra::Datastream::RightsMetadata do
|
4
|
+
before :all do
|
5
|
+
class RightsTest < ActiveFedora::Base
|
6
|
+
include Hydra::ModelMixins::RightsMetadata
|
7
|
+
has_metadata name: 'rightsMetadata', type: Hydra::Datastream::RightsMetadata
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
after :all do
|
12
|
+
Object.send(:remove_const,:RightsTest)
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "rightsMetadata" do
|
16
|
+
let!(:thing) {RightsTest.new}
|
17
|
+
|
18
|
+
[:discover,:read,:edit].each do |mode|
|
19
|
+
describe "##{mode}_users" do
|
20
|
+
let(:get_method) {"#{mode}_users".to_sym}
|
21
|
+
let(:set_method) {"#{mode}_users=".to_sym}
|
22
|
+
|
23
|
+
before :each do
|
24
|
+
thing.send(set_method, ['locutus@borg.collective.mil'])
|
25
|
+
thing.save
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should persist initial setting" do
|
29
|
+
thing.reload.send(get_method).should == ['locutus@borg.collective.mil']
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should persist changes" do
|
33
|
+
thing.send(set_method, ['locutus@borg.collective.mil','sevenofnine@borg.collective.mil'])
|
34
|
+
thing.save
|
35
|
+
thing.reload.send(get_method).should =~ ['locutus@borg.collective.mil','sevenofnine@borg.collective.mil']
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should persist emptiness" do
|
39
|
+
thing.send(set_method, [])
|
40
|
+
thing.save
|
41
|
+
thing.reload.send(get_method).should == []
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe "##{mode}_groups" do
|
46
|
+
let(:get_method) {"#{mode}_groups".to_sym}
|
47
|
+
let(:set_method) {"#{mode}_groups=".to_sym}
|
48
|
+
|
49
|
+
before :each do
|
50
|
+
thing.send(set_method, ['borg'])
|
51
|
+
thing.save
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should persist initial setting" do
|
55
|
+
thing.reload.send(get_method).should == ['borg']
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should persist changes" do
|
59
|
+
thing.send(set_method, ['borg','federation'])
|
60
|
+
thing.save
|
61
|
+
thing.reload.send(get_method).should =~ ['borg','federation']
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should persist emptiness" do
|
65
|
+
thing.send(set_method, [])
|
66
|
+
thing.save
|
67
|
+
thing.reload.send(get_method).should == []
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-access-controls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.3.
|
4
|
+
version: 6.3.3
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Chris Beer
|
@@ -10,25 +11,28 @@ authors:
|
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
|
-
date: 2013-
|
14
|
+
date: 2013-08-16 00:00:00.000000000 Z
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: activesupport
|
17
18
|
requirement: !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
18
20
|
requirements:
|
19
|
-
- - '>='
|
21
|
+
- - ! '>='
|
20
22
|
- !ruby/object:Gem::Version
|
21
23
|
version: '0'
|
22
24
|
type: :runtime
|
23
25
|
prerelease: false
|
24
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
25
28
|
requirements:
|
26
|
-
- - '>='
|
29
|
+
- - ! '>='
|
27
30
|
- !ruby/object:Gem::Version
|
28
31
|
version: '0'
|
29
32
|
- !ruby/object:Gem::Dependency
|
30
33
|
name: active-fedora
|
31
34
|
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
32
36
|
requirements:
|
33
37
|
- - ~>
|
34
38
|
- !ruby/object:Gem::Version
|
@@ -36,6 +40,7 @@ dependencies:
|
|
36
40
|
type: :runtime
|
37
41
|
prerelease: false
|
38
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
39
44
|
requirements:
|
40
45
|
- - ~>
|
41
46
|
- !ruby/object:Gem::Version
|
@@ -43,34 +48,39 @@ dependencies:
|
|
43
48
|
- !ruby/object:Gem::Dependency
|
44
49
|
name: cancan
|
45
50
|
requirement: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
46
52
|
requirements:
|
47
|
-
- - '>='
|
53
|
+
- - ! '>='
|
48
54
|
- !ruby/object:Gem::Version
|
49
55
|
version: '0'
|
50
56
|
type: :runtime
|
51
57
|
prerelease: false
|
52
58
|
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
53
60
|
requirements:
|
54
|
-
- - '>='
|
61
|
+
- - ! '>='
|
55
62
|
- !ruby/object:Gem::Version
|
56
63
|
version: '0'
|
57
64
|
- !ruby/object:Gem::Dependency
|
58
65
|
name: deprecation
|
59
66
|
requirement: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
60
68
|
requirements:
|
61
|
-
- - '>='
|
69
|
+
- - ! '>='
|
62
70
|
- !ruby/object:Gem::Version
|
63
71
|
version: '0'
|
64
72
|
type: :runtime
|
65
73
|
prerelease: false
|
66
74
|
version_requirements: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
67
76
|
requirements:
|
68
|
-
- - '>='
|
77
|
+
- - ! '>='
|
69
78
|
- !ruby/object:Gem::Version
|
70
79
|
version: '0'
|
71
80
|
- !ruby/object:Gem::Dependency
|
72
81
|
name: blacklight
|
73
82
|
requirement: !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
74
84
|
requirements:
|
75
85
|
- - ~>
|
76
86
|
- !ruby/object:Gem::Version
|
@@ -78,6 +88,7 @@ dependencies:
|
|
78
88
|
type: :runtime
|
79
89
|
prerelease: false
|
80
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
81
92
|
requirements:
|
82
93
|
- - ~>
|
83
94
|
- !ruby/object:Gem::Version
|
@@ -85,29 +96,33 @@ dependencies:
|
|
85
96
|
- !ruby/object:Gem::Dependency
|
86
97
|
name: rake
|
87
98
|
requirement: !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
88
100
|
requirements:
|
89
|
-
- - '>='
|
101
|
+
- - ! '>='
|
90
102
|
- !ruby/object:Gem::Version
|
91
103
|
version: '0'
|
92
104
|
type: :development
|
93
105
|
prerelease: false
|
94
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
95
108
|
requirements:
|
96
|
-
- - '>='
|
109
|
+
- - ! '>='
|
97
110
|
- !ruby/object:Gem::Version
|
98
111
|
version: '0'
|
99
112
|
- !ruby/object:Gem::Dependency
|
100
113
|
name: rspec
|
101
114
|
requirement: !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
102
116
|
requirements:
|
103
|
-
- - '>='
|
117
|
+
- - ! '>='
|
104
118
|
- !ruby/object:Gem::Version
|
105
119
|
version: '0'
|
106
120
|
type: :development
|
107
121
|
prerelease: false
|
108
122
|
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
109
124
|
requirements:
|
110
|
-
- - '>='
|
125
|
+
- - ! '>='
|
111
126
|
- !ruby/object:Gem::Version
|
112
127
|
version: '0'
|
113
128
|
description: Access controls for project hydra
|
@@ -152,6 +167,7 @@ files:
|
|
152
167
|
- spec/unit/ability_spec.rb
|
153
168
|
- spec/unit/access_controls_enforcement_spec.rb
|
154
169
|
- spec/unit/admin_policy_spec.rb
|
170
|
+
- spec/unit/hydra_rights_metadata_persistence_spec.rb
|
155
171
|
- spec/unit/hydra_rights_metadata_spec.rb
|
156
172
|
- spec/unit/inheritable_rights_metadata_spec.rb
|
157
173
|
- spec/unit/policy_aware_ability_spec.rb
|
@@ -162,26 +178,27 @@ files:
|
|
162
178
|
homepage: http://projecthydra.org
|
163
179
|
licenses:
|
164
180
|
- APACHE2
|
165
|
-
metadata: {}
|
166
181
|
post_install_message:
|
167
182
|
rdoc_options: []
|
168
183
|
require_paths:
|
169
184
|
- lib
|
170
185
|
required_ruby_version: !ruby/object:Gem::Requirement
|
186
|
+
none: false
|
171
187
|
requirements:
|
172
|
-
- - '>='
|
188
|
+
- - ! '>='
|
173
189
|
- !ruby/object:Gem::Version
|
174
190
|
version: 1.9.3
|
175
191
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
192
|
+
none: false
|
176
193
|
requirements:
|
177
|
-
- - '>='
|
194
|
+
- - ! '>='
|
178
195
|
- !ruby/object:Gem::Version
|
179
196
|
version: '0'
|
180
197
|
requirements: []
|
181
198
|
rubyforge_project:
|
182
|
-
rubygems_version:
|
199
|
+
rubygems_version: 1.8.23
|
183
200
|
signing_key:
|
184
|
-
specification_version:
|
201
|
+
specification_version: 3
|
185
202
|
summary: Access controls for project hydra
|
186
203
|
test_files:
|
187
204
|
- spec/factories.rb
|
@@ -196,6 +213,7 @@ test_files:
|
|
196
213
|
- spec/unit/ability_spec.rb
|
197
214
|
- spec/unit/access_controls_enforcement_spec.rb
|
198
215
|
- spec/unit/admin_policy_spec.rb
|
216
|
+
- spec/unit/hydra_rights_metadata_persistence_spec.rb
|
199
217
|
- spec/unit/hydra_rights_metadata_spec.rb
|
200
218
|
- spec/unit/inheritable_rights_metadata_spec.rb
|
201
219
|
- spec/unit/policy_aware_ability_spec.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: d02a342a99ab54d6be798a0f0f2d2ae479f518a1
|
4
|
-
data.tar.gz: bb95f71e73450a6878d6fad434b5640cf58b633a
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: be56500f51d49197e1add0a38082474fab5d0ef2a15afec5117b8a765cd6c5a1a59b6e6cfdedc3ff31bff017cbf2e584c0eac0b9d4a258d0f00cadd48b7535e6
|
7
|
-
data.tar.gz: 6ed343fe7cadccc9ffd0be60a508179159538ba6a8434e38ac5ad49333dc0b2488f2bb8e79c034ed8e4b00b54c9b6a18f56121ae1ea735bf7392d039943cb7f1
|