infopark_fiona7 0.71.0.4 → 0.71.0.6

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: 2943d8f71016c77e2923a62ebdc4c196046c7a12
4
- data.tar.gz: 8cab80405cc8c406104dc1cf6f468ce63f8a3723
3
+ metadata.gz: c14523518e257dd8aac6700eee128ff69aaa9741
4
+ data.tar.gz: 693b82cb59011cac2c96c6b1c83a72d1967b761d
5
5
  SHA512:
6
- metadata.gz: 29ebb08d03e8b21b8b01abaabd831a538365670613f4c19983fb23762a375109f8aefcabca4e723d1486b1af650c113c1165937d99c16e859070891176a3d433
7
- data.tar.gz: 2286addb1ac034a38e69678963fd40ea175a03d784be6a301b7944e105e1fdfce9c1d6fc0339d30546590c6d9976136ab1f3a52dc1f202fcc10bdfac7dde6ff8
6
+ metadata.gz: 311e175c753051f99eccf5bdb03d8abec2e0e6065b8a1111cad6d7fcb5c04747f231796b5e590f7a55e13f562b1e54bf3f585d5c3dad13e3af08b23dad8bdbd7
7
+ data.tar.gz: 2a55154cf81b325cfd6e8395b411d4cd9674c971bce3e99fe6335bf92ada195ea2f1f639555bc7ce6f0a09448622a97578467709d7219650d0230c6fd7e21414
@@ -44,7 +44,8 @@ module Fiona7OverrideHelper
44
44
  scrivito_tag_list(tag_name, obj, field_name, options) do |list, scrivito_child|
45
45
  fiona_child = children_map[scrivito_child.id]
46
46
 
47
- next unless fiona_child.exportable? # suppress_export !
47
+ next if fiona_child.suppressed? # suppress_export
48
+ next if !scrivito_in_editable_view? && !fiona_child.active? # valid_from & valid_until
48
49
 
49
50
  block.call(list, fiona_child)
50
51
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_dependency "scrivito_sdk"
22
22
  s.add_dependency "scrivito_editors"
23
23
  s.add_dependency "infopark_fiona_connector", "= 7.0.1.beta2"
24
- s.add_dependency "infopark_reactor", "= 1.15.0.beta1"
24
+ s.add_dependency "infopark_reactor", ">= 1.16.0"
25
25
  s.add_dependency "mini_magick"
26
26
  s.add_development_dependency "ruby-prof"
27
27
  end
@@ -1,3 +1,5 @@
1
+ require 'fiona7/editing_env_check'
2
+
1
3
  module Fiona7
2
4
  class AccessPermissionCheck
3
5
  def initialize(obj, env, rc_user, reactor_user)
@@ -19,8 +21,7 @@ module Fiona7
19
21
  attr_accessor :obj, :env, :rc_user, :reactor_user
20
22
 
21
23
  def editing?
22
- editing_context = self.env[Scrivito::EditingContextMiddleware::ENVKEY]
23
- editing_context && editing_context.authenticated_editor? && selected_workspace_id(editing_context) == 'rtc'
24
+ Fiona7::EditingEnvCheck.new(self.env).check?
24
25
  end
25
26
 
26
27
  # this is very quick!
@@ -39,12 +40,5 @@ module Fiona7
39
40
  end
40
41
  end
41
42
 
42
- private
43
- def selected_workspace_id(editing_context)
44
- # NOTE: this does not require workspace lookup/load_obj
45
- # and thus is potentially faster
46
- editing_context.instance_variable_get(:@selected_workspace_id).to_s
47
- end
48
-
49
43
  end
50
44
  end
@@ -1,20 +1,12 @@
1
+ require 'fiona7/in_editable_view'
2
+
1
3
  module Fiona7
2
4
  module ControllerHelper
3
- def editing_context
4
- Scrivito::EditingContextMiddleware.from_request(request)
5
- end
6
-
7
- def scrivito_in_editable_view?
8
- editing_context.editable_display_mode?
9
- end
10
-
11
- def fiona7_in_editable_view?
12
- scrivito_in_editable_view?
13
- end
5
+ include InEditableView
14
6
 
15
7
  def self.included(base)
16
- base.send(:helper_method, :scrivito_in_editable_view?)
17
- base.send(:helper_method, :fiona7_in_editable_view?)
8
+ base.__send__(:helper_method, :scrivito_in_editable_view?)
9
+ base.__send__(:helper_method, :fiona7_in_editable_view?)
18
10
  end
19
11
  end
20
12
  end
@@ -0,0 +1,23 @@
1
+ module Fiona7
2
+ class EditingEnvCheck
3
+ def initialize(env)
4
+ self.env = env
5
+ end
6
+
7
+ def check?
8
+ editing_context = self.env[Scrivito::EditingContextMiddleware::ENVKEY]
9
+ editing_context && editing_context.authenticated_editor? && selected_workspace_id(editing_context) == 'rtc'
10
+ end
11
+
12
+ protected
13
+ attr_accessor :env
14
+
15
+ private
16
+ def selected_workspace_id(editing_context)
17
+ # NOTE: this does not require workspace lookup/load_obj
18
+ # and thus is potentially faster
19
+ editing_context.instance_variable_get(:@selected_workspace_id).to_s
20
+ end
21
+ end
22
+ end
23
+
@@ -1,8 +1,12 @@
1
1
  require 'rails_connector/cms_accessible'
2
+ require 'fiona7/editing_env_check'
2
3
  require 'fiona7/access_permission_check'
4
+ require 'fiona7/in_editable_view'
3
5
 
4
6
  module RailsConnector
5
7
  module CmsAccessible
8
+ protected
9
+
6
10
  # changed to check live and read permissions
7
11
  def ensure_object_is_permitted
8
12
  unless Fiona7::AccessPermissionCheck.new(@obj, request.env, current_user, rsession && rsession.user? && rsession.user).read_permitted?
@@ -12,5 +16,28 @@ module RailsConnector
12
16
  end
13
17
  return true
14
18
  end
19
+
20
+ # allow unreleased objects in editing mode
21
+ def ensure_object_is_active
22
+ return true if Fiona7::EditingEnvCheck.new(request.env).check?
23
+
24
+ unless @obj.active?
25
+ @valid_from = @obj.valid_from
26
+ @valid_until = @obj.valid_until
27
+ @obj = nil
28
+ render_obj_error(410, "gone")
29
+ return false
30
+ end
31
+ return true
32
+ end
33
+
34
+ include Fiona7::InEditableView
35
+
36
+ def self.included(base)
37
+ base.__send__(:helper_method, :is_permitted)
38
+ base.__send__(:helper_method, :scrivito_in_editable_view?)
39
+ base.__send__(:helper_method, :fiona7_in_editable_view?)
40
+ end
41
+
15
42
  end
16
43
  end
@@ -0,0 +1,15 @@
1
+ module Fiona7
2
+ module InEditableView
3
+ def editing_context
4
+ Scrivito::EditingContextMiddleware.from_request(request)
5
+ end
6
+
7
+ def scrivito_in_editable_view?
8
+ editing_context.editable_display_mode?
9
+ end
10
+
11
+ def fiona7_in_editable_view?
12
+ scrivito_in_editable_view?
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Fiona7
2
- VERSION = "0.71.0.4"
2
+ VERSION = "0.71.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infopark_fiona7
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.71.0.4
4
+ version: 0.71.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Przedmojski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-29 00:00:00.000000000 Z
11
+ date: 2015-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: infopark_reactor
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 1.15.0.beta1
89
+ version: 1.16.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 1.15.0.beta1
96
+ version: 1.16.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: mini_magick
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -182,9 +182,11 @@ files:
182
182
  - lib/fiona7/controllers/rest_api/blob_controller.rb
183
183
  - lib/fiona7/controllers/rest_api/obj_controller.rb
184
184
  - lib/fiona7/controllers/rest_api/workspace_controller.rb
185
+ - lib/fiona7/editing_env_check.rb
185
186
  - lib/fiona7/engine.rb
186
187
  - lib/fiona7/fiona_connector_patches/basic_obj.rb
187
188
  - lib/fiona7/fiona_connector_patches/cms_accessible.rb
189
+ - lib/fiona7/in_editable_view.rb
188
190
  - lib/fiona7/initializer.rb
189
191
  - lib/fiona7/json/obj_decorator.rb
190
192
  - lib/fiona7/json/reverse_obj_decorator.rb