ddr-models 3.0.0.beta.22 → 3.0.0.rc1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e6b6dc994859b545193b3ab914a59a97d465a9a
|
4
|
+
data.tar.gz: 3bcd281d06aa80c0fa1eb970d809e55eae905d26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d69f123b6661631477dd7d6722ef911bde491831d38ed0f4f14eabd7b33649622e517353d8445a101278018fad45ea014cb1bbe2134dba5c961f06fab5d86550
|
7
|
+
data.tar.gz: 73050a50d9221d5ec777183b319862a64b2a724b24caf4d22c72f6cca011d6f43b8fd8241479772b6d4abe027503f1658abf2aa00f6ea191f76b2fedeb2b4fe6
|
@@ -2,7 +2,7 @@ module Ddr
|
|
2
2
|
module Auth
|
3
3
|
class LockAbilityDefinitions < AbilityDefinitions
|
4
4
|
|
5
|
-
DENIED_WHEN_LOCKED = [ :add_children, :update, :replace, :arrange, :grant ]
|
5
|
+
DENIED_WHEN_LOCKED = [ :add_children, :update, :replace, :arrange, :publish, :unpublish, :grant ]
|
6
6
|
|
7
7
|
def call
|
8
8
|
cannot DENIED_WHEN_LOCKED, Ddr::Models::Base, :locked? => true
|
data/lib/ddr/models/version.rb
CHANGED
data/spec/auth/ability_spec.rb
CHANGED
@@ -211,13 +211,14 @@ module Ddr::Auth
|
|
211
211
|
end
|
212
212
|
|
213
213
|
describe "locks" do
|
214
|
-
let(:obj) { Ddr::Models::Base.new }
|
215
214
|
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
215
|
+
before do
|
216
|
+
allow(obj).to receive(:effective_permissions) { Permissions::ALL }
|
217
|
+
allow(obj).to receive(:locked?) { true }
|
218
|
+
end
|
219
|
+
|
220
|
+
describe "effects of locks on non-publication abilities" do
|
221
|
+
let(:obj) { Ddr::Models::Base.new }
|
221
222
|
it { should be_able_to(:read, obj) }
|
222
223
|
it { should be_able_to(:download, obj) }
|
223
224
|
it { should_not be_able_to(:add_children, obj) }
|
@@ -227,6 +228,17 @@ module Ddr::Auth
|
|
227
228
|
it { should be_able_to(:audit, obj) }
|
228
229
|
it { should_not be_able_to(:grant, obj) }
|
229
230
|
end
|
231
|
+
|
232
|
+
describe "effects of locks on publication abilities" do
|
233
|
+
let(:obj) { Collection.new }
|
234
|
+
describe "unpublished object" do
|
235
|
+
it { should_not be_able_to(:publish, obj) }
|
236
|
+
end
|
237
|
+
describe "published object" do
|
238
|
+
before { allow(obj).to receive(:published?) { true } }
|
239
|
+
it { should_not be_able_to(:unpublish, obj) }
|
240
|
+
end
|
241
|
+
end
|
230
242
|
end
|
231
243
|
|
232
244
|
describe "role based abilities" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddr-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.
|
4
|
+
version: 3.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Coble
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-04-
|
12
|
+
date: 2016-04-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|