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: be76ea6556d342a363b32dbb38bad6951106d26f
4
- data.tar.gz: 9847925960b3a93eec7de2fba2b2e5f3b5a4148b
3
+ metadata.gz: 3e6b6dc994859b545193b3ab914a59a97d465a9a
4
+ data.tar.gz: 3bcd281d06aa80c0fa1eb970d809e55eae905d26
5
5
  SHA512:
6
- metadata.gz: 8107313d9506c0070bc6cd3b67807b823e511ea95f7cc1c461cbed2b40b983a67e777822bd63428c8e3d9fdd5fcb89e4f453b42a242e19b1b958f39f3c499a37
7
- data.tar.gz: d5d0fdc1fa5b567e0a523d9192c1fbb14eeb5b59bce69e7162c3981677caa03b895e156d1b5882cbf5bcbae509f3a322d381c4e192d0464f3d954386e4563b23
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
@@ -1,5 +1,5 @@
1
1
  module Ddr
2
2
  module Models
3
- VERSION = "3.0.0.beta.22"
3
+ VERSION = "3.0.0.rc1"
4
4
  end
5
5
  end
@@ -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
- describe "effects of locks on abilities" do
217
- before do
218
- allow(obj).to receive(:effective_permissions) { Permissions::ALL }
219
- allow(obj).to receive(:locked?) { true }
220
- end
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.beta.22
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-21 00:00:00.000000000 Z
12
+ date: 2016-04-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails