infopark_reactor 1.26.1 → 1.27.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +25 -0
  3. data/.rubocop_todo.yml +363 -0
  4. data/Rakefile +10 -13
  5. data/app/models/rails_connector/abstract_obj.rb +2 -1
  6. data/config/routes.rb +0 -1
  7. data/infopark_reactor.gemspec +16 -15
  8. data/lib/generators/cm/migration/migration_generator.rb +4 -8
  9. data/lib/infopark_reactor.rb +43 -69
  10. data/lib/reactor/already_released.rb +1 -2
  11. data/lib/reactor/attributes.rb +92 -268
  12. data/lib/reactor/attributes/date_serializer.rb +20 -16
  13. data/lib/reactor/attributes/html_serializer.rb +6 -5
  14. data/lib/reactor/attributes/link_list_extender.rb +10 -8
  15. data/lib/reactor/attributes/link_list_from_accessor.rb +2 -1
  16. data/lib/reactor/attributes/link_list_from_attr_values.rb +2 -1
  17. data/lib/reactor/attributes/link_list_serializer.rb +8 -7
  18. data/lib/reactor/attributes_handlers.rb +164 -0
  19. data/lib/reactor/cache/permission.rb +6 -9
  20. data/lib/reactor/cache/user.rb +3 -6
  21. data/lib/reactor/cm/attribute.rb +16 -16
  22. data/lib/reactor/cm/attribute_group.rb +18 -21
  23. data/lib/reactor/cm/blob_too_small_error.rb +2 -2
  24. data/lib/reactor/cm/bridge.rb +6 -9
  25. data/lib/reactor/cm/channel.rb +3 -4
  26. data/lib/reactor/cm/editorial_group.rb +2 -9
  27. data/lib/reactor/cm/group.rb +30 -43
  28. data/lib/reactor/cm/job.rb +23 -25
  29. data/lib/reactor/cm/language.rb +21 -22
  30. data/lib/reactor/cm/link.rb +38 -40
  31. data/lib/reactor/cm/live_group.rb +2 -9
  32. data/lib/reactor/cm/log_entry.rb +22 -21
  33. data/lib/reactor/cm/missing_credentials.rb +3 -2
  34. data/lib/reactor/cm/multi_xml_request.rb +22 -25
  35. data/lib/reactor/cm/obj.rb +159 -154
  36. data/lib/reactor/cm/obj_class.rb +52 -51
  37. data/lib/reactor/cm/object_base.rb +26 -21
  38. data/lib/reactor/cm/permissions.rb +7 -7
  39. data/lib/reactor/cm/user.rb +43 -51
  40. data/lib/reactor/cm/workflow.rb +11 -12
  41. data/lib/reactor/cm/xml_attribute.rb +10 -19
  42. data/lib/reactor/cm/xml_markup.rb +7 -10
  43. data/lib/reactor/cm/xml_multi_request_error.rb +1 -3
  44. data/lib/reactor/cm/xml_request.rb +21 -29
  45. data/lib/reactor/cm/xml_request_error.rb +1 -3
  46. data/lib/reactor/cm/xml_response.rb +8 -16
  47. data/lib/reactor/cm/xml_single_request_error.rb +3 -5
  48. data/lib/reactor/configuration.rb +1 -3
  49. data/lib/reactor/engine.rb +5 -10
  50. data/lib/reactor/legacy.rb +6 -7
  51. data/lib/reactor/link/external.rb +8 -5
  52. data/lib/reactor/link/internal.rb +8 -5
  53. data/lib/reactor/link/temporary_link.rb +16 -17
  54. data/lib/reactor/main.rb +11 -15
  55. data/lib/reactor/migration.rb +52 -53
  56. data/lib/reactor/no_working_version.rb +1 -2
  57. data/lib/reactor/not_permitted.rb +1 -2
  58. data/lib/reactor/permission.rb +36 -38
  59. data/lib/reactor/persistence.rb +104 -178
  60. data/lib/reactor/plans/common_attribute.rb +7 -7
  61. data/lib/reactor/plans/common_attribute_group.rb +6 -6
  62. data/lib/reactor/plans/common_channel.rb +6 -6
  63. data/lib/reactor/plans/common_group.rb +7 -14
  64. data/lib/reactor/plans/common_job.rb +6 -6
  65. data/lib/reactor/plans/common_obj_class.rb +11 -11
  66. data/lib/reactor/plans/create_attribute.rb +1 -3
  67. data/lib/reactor/plans/create_attribute_group.rb +1 -3
  68. data/lib/reactor/plans/create_channel.rb +2 -3
  69. data/lib/reactor/plans/create_group.rb +3 -10
  70. data/lib/reactor/plans/create_job.rb +3 -4
  71. data/lib/reactor/plans/create_obj.rb +12 -14
  72. data/lib/reactor/plans/create_obj_class.rb +1 -2
  73. data/lib/reactor/plans/delete_attribute.rb +1 -3
  74. data/lib/reactor/plans/delete_attribute_group.rb +2 -4
  75. data/lib/reactor/plans/delete_channel.rb +3 -6
  76. data/lib/reactor/plans/delete_group.rb +2 -9
  77. data/lib/reactor/plans/delete_job.rb +3 -5
  78. data/lib/reactor/plans/delete_obj.rb +3 -4
  79. data/lib/reactor/plans/delete_obj_class.rb +1 -2
  80. data/lib/reactor/plans/prepared.rb +3 -4
  81. data/lib/reactor/plans/rename_group.rb +4 -11
  82. data/lib/reactor/plans/rename_obj_class.rb +1 -2
  83. data/lib/reactor/plans/update_attribute.rb +1 -3
  84. data/lib/reactor/plans/update_attribute_group.rb +2 -4
  85. data/lib/reactor/plans/update_group.rb +2 -9
  86. data/lib/reactor/plans/update_job.rb +4 -8
  87. data/lib/reactor/plans/update_obj.rb +6 -7
  88. data/lib/reactor/plans/update_obj_class.rb +0 -2
  89. data/lib/reactor/rc_independent.rb +0 -1
  90. data/lib/reactor/session.rb +27 -31
  91. data/lib/reactor/session/observers.rb +3 -5
  92. data/lib/reactor/session/user.rb +6 -7
  93. data/lib/reactor/session_helper/auth_filter.rb +9 -0
  94. data/lib/reactor/session_helper/auth_helper.rb +24 -0
  95. data/lib/reactor/session_helper/rsession_helper.rb +16 -0
  96. data/lib/reactor/session_helper/session_state.rb +31 -0
  97. data/lib/reactor/streaming_upload.rb +0 -1
  98. data/lib/reactor/sudo.rb +2 -3
  99. data/lib/reactor/support/link_matcher.rb +8 -7
  100. data/lib/reactor/tools/migrator.rb +30 -35
  101. data/lib/reactor/tools/response_handler/xml_attribute.rb +27 -33
  102. data/lib/reactor/tools/smart_xml_logger.rb +20 -22
  103. data/lib/reactor/tools/sower.rb +22 -23
  104. data/lib/reactor/tools/uploader.rb +12 -17
  105. data/lib/reactor/tools/versioner.rb +29 -30
  106. data/lib/reactor/tools/where_query.rb +11 -14
  107. data/lib/reactor/tools/workflow_generator.rb +26 -28
  108. data/lib/reactor/tools/xml_attributes.rb +7 -14
  109. data/lib/reactor/tools/xpath_extractor.rb +2 -1
  110. data/lib/reactor/validations.rb +20 -16
  111. data/lib/reactor/version.rb +1 -2
  112. data/lib/reactor/workflow.rb +10 -33
  113. data/lib/reactor/workflow/comment.rb +28 -0
  114. data/lib/reactor/workflow/empty.rb +0 -1
  115. data/lib/reactor/workflow/standard.rb +4 -3
  116. data/lib/tasks/cm_migrate.rake +3 -3
  117. data/lib/tasks/cm_seeds.rake +9 -16
  118. metadata +64 -28
  119. data/app/models/rails_connector/abstract_model.rb +0 -7
  120. data/app/models/rails_connector/attribute.rb +0 -94
  121. data/app/models/rails_connector/blob_mapping.rb +0 -16
  122. data/app/models/rails_connector/channel.rb +0 -41
  123. data/app/models/rails_connector/content.rb +0 -12
  124. data/app/models/rails_connector/job.rb +0 -14
  125. data/app/models/rails_connector/obj_class.rb +0 -158
  126. data/app/models/rails_connector/obj_class_attr.rb +0 -5
  127. data/app/models/rails_connector/object_with_meta_data.rb +0 -18
  128. data/lib/rails_connector/meta/eager_loader.rb +0 -91
  129. data/lib/reactor/rails_connector_meta.rb +0 -149
  130. data/lib/reactor/session_helper.rb +0 -72
@@ -1,15 +1,18 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Reactor
3
2
  module Link
4
3
  class Internal
5
4
  attr_accessor :destination_object
6
5
 
7
- def external? ; false ; end
8
- def internal? ; true ; end
6
+ def external?
7
+ false
8
+ end
9
+
10
+ def internal?
11
+ true
12
+ end
9
13
 
10
- def initialize(anything)
14
+ def initialize(_anything)
11
15
  raise TypeError, "#{self.class.name} is deprecated!"
12
- self.destination_object = Obj.obj_from_anything(anything)
13
16
  end
14
17
 
15
18
  def id
@@ -1,13 +1,16 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Reactor
3
2
  module Link
4
3
  class TemporaryLink
5
4
  attr_reader :url
6
- attr_accessor :title
7
- attr_accessor :target
5
+ attr_accessor :title, :target
8
6
 
9
- def external? ; raise TypeError, "This link needs to be persisted to gain any meaningful information" ; end
10
- def internal? ; false ; end
7
+ def external?
8
+ raise TypeError, "This link needs to be persisted to gain any meaningful information"
9
+ end
10
+
11
+ def internal?
12
+ false
13
+ end
11
14
 
12
15
  def initialize(anything)
13
16
  link_data = {}
@@ -21,24 +24,20 @@ module Reactor
21
24
  link_data[:url] = anything
22
25
  end
23
26
 
24
- self.url = link_data[:url] || link_data[:destination_object]
25
- if link_data[:search].present?
26
- self.url = "#{self.url}?#{link_data[:search]}"
27
- end
28
- if link_data[:fragment].present?
29
- self.url = "#{self.url}##{link_data[:fragment]}"
30
- end
27
+ self.url = link_data[:url] || link_data[:destination_object]
28
+ self.url = "#{url}?#{link_data[:search]}" if link_data[:search].present?
29
+ self.url = "#{url}##{link_data[:fragment]}" if link_data[:fragment].present?
31
30
  self.target = link_data[:target] if link_data.key?(:target)
32
31
  self.title = link_data[:title] if link_data.key?(:title)
33
32
  end
34
33
 
35
34
  def url=(some_target)
36
35
  @url = case some_target
37
- when RailsConnector::AbstractObj
38
- @destination_object = some_target
39
- some_target.path
40
- else
41
- some_target
36
+ when RailsConnector::AbstractObj
37
+ @destination_object = some_target
38
+ some_target.path
39
+ else
40
+ some_target
42
41
  end
43
42
  end
44
43
 
@@ -1,21 +1,17 @@
1
- require 'reactor/rails_connector_meta'
2
- require 'reactor/legacy'
3
- require 'reactor/attributes'
4
- require 'reactor/persistence'
5
- require 'reactor/validations'
6
- require 'reactor/permission'
7
- require 'reactor/workflow'
8
- require 'reactor/streaming_upload'
9
-
10
1
  module Reactor
11
2
  module Main
12
3
  def self.included(base)
13
- [RailsConnector::Meta, Reactor::Legacy::Base,
14
- Reactor::Attributes::Base, Reactor::Persistence::Base,
15
- Reactor::Validations::Base, Reactor::Permission::Base,
16
- Reactor::Workflow::Base, Reactor::StreamingUpload::Base].each do |mod|
17
- base.send(:include, mod)
18
- end
4
+ [
5
+ Reactor::Legacy::Base,
6
+ Reactor::Attributes::Base,
7
+ Reactor::Persistence::Base,
8
+ Reactor::Validations::Base,
9
+ Reactor::Permission::Base,
10
+ Reactor::Workflow::Base,
11
+ Reactor::StreamingUpload::Base
12
+ ].each do |mod|
13
+ base.send(:include, mod)
14
+ end
19
15
  end
20
16
  end
21
17
  end
@@ -1,58 +1,57 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'reactor/plans/create_obj'
3
- require 'reactor/plans/delete_obj'
4
- require 'reactor/plans/update_obj'
5
- require 'reactor/plans/create_obj_class'
6
- require 'reactor/plans/delete_obj_class'
7
- require 'reactor/plans/update_obj_class'
8
- require 'reactor/plans/rename_obj_class'
9
- require 'reactor/plans/create_attribute'
10
- require 'reactor/plans/delete_attribute'
11
- require 'reactor/plans/update_attribute'
12
- require 'reactor/plans/create_attribute_group'
13
- require 'reactor/plans/delete_attribute_group'
14
- require 'reactor/plans/update_attribute_group'
15
- require 'reactor/plans/create_group'
16
- require 'reactor/plans/update_group'
17
- require 'reactor/plans/delete_group'
18
- require 'reactor/plans/rename_group'
19
- require 'reactor/plans/create_channel'
20
- require 'reactor/plans/delete_channel'
21
- require 'reactor/plans/create_job'
22
- require 'reactor/plans/update_job'
23
- require 'reactor/plans/delete_job'
1
+ require "reactor/plans/create_obj"
2
+ require "reactor/plans/delete_obj"
3
+ require "reactor/plans/update_obj"
4
+ require "reactor/plans/create_obj_class"
5
+ require "reactor/plans/delete_obj_class"
6
+ require "reactor/plans/update_obj_class"
7
+ require "reactor/plans/rename_obj_class"
8
+ require "reactor/plans/create_attribute"
9
+ require "reactor/plans/delete_attribute"
10
+ require "reactor/plans/update_attribute"
11
+ require "reactor/plans/create_attribute_group"
12
+ require "reactor/plans/delete_attribute_group"
13
+ require "reactor/plans/update_attribute_group"
14
+ require "reactor/plans/create_group"
15
+ require "reactor/plans/update_group"
16
+ require "reactor/plans/delete_group"
17
+ require "reactor/plans/rename_group"
18
+ require "reactor/plans/create_channel"
19
+ require "reactor/plans/delete_channel"
20
+ require "reactor/plans/create_job"
21
+ require "reactor/plans/update_job"
22
+ require "reactor/plans/delete_job"
24
23
 
25
24
  module Reactor
26
25
  class Migration
27
26
  METHODS = {
28
- :create_obj => Plans::CreateObj,
29
- :delete_obj => Plans::DeleteObj,
30
- :update_obj => Plans::UpdateObj,
31
- :create_class => Plans::CreateObjClass,
32
- :delete_class => Plans::DeleteObjClass,
33
- :update_class => Plans::UpdateObjClass,
34
- :rename_class => Plans::RenameObjClass,
35
- :create_attribute => Plans::CreateAttribute,
36
- :delete_attribute => Plans::DeleteAttribute,
37
- :update_attribute => Plans::UpdateAttribute,
38
- :create_attribute_group => Plans::CreateAttributeGroup,
39
- :delete_attribute_group => Plans::DeleteAttributeGroup,
40
- :update_attribute_group => Plans::UpdateAttributeGroup,
41
- :create_group => Plans::CreateGroup,
42
- :delete_group => Plans::DeleteGroup,
43
- :update_group => Plans::UpdateGroup,
44
- :rename_group => Plans::RenameGroup,
45
- :create_channel => Plans::CreateChannel,
46
- :delete_channel => Plans::DeleteChannel,
47
- :create_job => Plans::CreateJob,
48
- :delete_job => Plans::DeleteJob,
49
- :update_job => Plans::UpdateJob
50
- }
27
+ create_obj: Plans::CreateObj,
28
+ delete_obj: Plans::DeleteObj,
29
+ update_obj: Plans::UpdateObj,
30
+ create_class: Plans::CreateObjClass,
31
+ delete_class: Plans::DeleteObjClass,
32
+ update_class: Plans::UpdateObjClass,
33
+ rename_class: Plans::RenameObjClass,
34
+ create_attribute: Plans::CreateAttribute,
35
+ delete_attribute: Plans::DeleteAttribute,
36
+ update_attribute: Plans::UpdateAttribute,
37
+ create_attribute_group: Plans::CreateAttributeGroup,
38
+ delete_attribute_group: Plans::DeleteAttributeGroup,
39
+ update_attribute_group: Plans::UpdateAttributeGroup,
40
+ create_group: Plans::CreateGroup,
41
+ delete_group: Plans::DeleteGroup,
42
+ update_group: Plans::UpdateGroup,
43
+ rename_group: Plans::RenameGroup,
44
+ create_channel: Plans::CreateChannel,
45
+ delete_channel: Plans::DeleteChannel,
46
+ create_job: Plans::CreateJob,
47
+ delete_job: Plans::DeleteJob,
48
+ update_job: Plans::UpdateJob
49
+ }.freeze
51
50
 
52
51
  def self.method_missing(name, *args, &block)
53
- if METHODS.key? name.to_sym then
54
- instance = init(name,*args)
55
- plan(instance,&block)
52
+ if METHODS.key? name.to_sym
53
+ instance = init(name, *args)
54
+ plan(instance, &block)
56
55
  prepare(instance)
57
56
  migrate(instance)
58
57
  else
@@ -76,12 +75,11 @@ module Reactor
76
75
  @contained || []
77
76
  end
78
77
 
79
- protected
80
- def self.init(name,*args)
78
+ def self.init(name, *args)
81
79
  METHODS[name.to_sym].new(*args)
82
80
  end
83
81
 
84
- def self.plan(instance,&block)
82
+ def self.plan(instance, &block)
85
83
  instance.instance_eval(&block) if block_given?
86
84
  end
87
85
 
@@ -94,6 +92,7 @@ module Reactor
94
92
  end
95
93
 
96
94
  private
97
- def initialize ; end
95
+
96
+ def initialize; end
98
97
  end
99
98
  end
@@ -1,2 +1 @@
1
- # -*- encoding : utf-8 -*-
2
- class Reactor::NoWorkingVersion < StandardError ; end
1
+ class Reactor::NoWorkingVersion < StandardError; end
@@ -1,2 +1 @@
1
- # -*- encoding : utf-8 -*-
2
- class Reactor::NotPermitted < StandardError ; end
1
+ class Reactor::NotPermitted < StandardError; end
@@ -1,10 +1,8 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'reactor/session'
3
- require 'reactor/cache/permission'
4
- require 'reactor/cache/user'
1
+ require "reactor/session"
2
+ require "reactor/cache/permission"
3
+ require "reactor/cache/user"
5
4
 
6
5
  module Reactor
7
-
8
6
  # This module adds #permission method to obj that act as a gateway for permission checking,
9
7
  # see documentation for [Permission::PermissionProxy] for more details.
10
8
  # @see [Permission::PermissionProxy]
@@ -16,9 +14,7 @@ module Reactor
16
14
  #
17
15
  # Therefore if the user lacks permissions no futher actions are executed.
18
16
  module Permission
19
-
20
17
  module Base
21
-
22
18
  # @see [PermissionProxy]
23
19
  def permission
24
20
  @permission ||= PermissionProxy.new(self)
@@ -29,7 +25,7 @@ module Reactor
29
25
  # @raise [Reactor::NotPermitted] user lacks neccessary permission
30
26
  def release!(*args)
31
27
  ensure_permission_granted(:release)
32
- return super
28
+ super
33
29
  end
34
30
 
35
31
  # Wraps around Reactor::Persistence::Base#take! and ensures
@@ -37,7 +33,7 @@ module Reactor
37
33
  # @raise [Reactor::NotPermitted] user lacks neccessary permission
38
34
  def take!(*args)
39
35
  ensure_permission_granted(:take)
40
- return super
36
+ super
41
37
  end
42
38
 
43
39
  # Wraps around Reactor::Persistence::Base#revert! and ensures
@@ -45,7 +41,7 @@ module Reactor
45
41
  # @raise [Reactor::NotPermitted] user lacks neccessary permission
46
42
  def revert!(*args)
47
43
  ensure_permission_granted(:revert)
48
- return super
44
+ super
49
45
  end
50
46
 
51
47
  # Wraps around Reactor::Persistence::Base#edit! and ensures
@@ -53,7 +49,7 @@ module Reactor
53
49
  # @raise [Reactor::NotPermitted] user lacks neccessary permission
54
50
  def edit!(*args)
55
51
  ensure_permission_granted(:edit)
56
- return super
52
+ super
57
53
  end
58
54
 
59
55
  # Wraps around ActiveRecord::Persistence#save and ensures
@@ -63,11 +59,11 @@ module Reactor
63
59
  if persisted?
64
60
  ensure_permission_granted(:write)
65
61
  else
66
- ensure_create_permission_granted(self.parent_obj_id)
62
+ ensure_create_permission_granted(parent_obj_id)
67
63
  end
68
- return super
64
+ super
69
65
  rescue Reactor::NotPermitted
70
- return false
66
+ false
71
67
  end
72
68
 
73
69
  # Wraps around ActiveRecord::Persistence#save! and ensures
@@ -77,9 +73,9 @@ module Reactor
77
73
  if persisted?
78
74
  ensure_permission_granted(:write)
79
75
  else
80
- ensure_create_permission_granted(self.parent_obj_id)
76
+ ensure_create_permission_granted(parent_obj_id)
81
77
  end
82
- return super
78
+ super
83
79
  end
84
80
 
85
81
  # Wraps around Reactor::Persistence::Base#resolve_refs! and ensures
@@ -87,22 +83,29 @@ module Reactor
87
83
  # @raise [Reactor::NotPermitted] user lacks neccessary permission
88
84
  def resolve_refs!
89
85
  ensure_permission_granted(:write)
90
- return super
86
+ super
91
87
  end
92
88
 
93
89
  private
94
90
 
95
91
  def ensure_permission_granted(type)
96
- raise Reactor::NotPermitted, "#{self.path} lacks neccessary permissions for #{type}" unless self.permission.send("#{type}?")
97
- return true
92
+ unless permission.send("#{type}?")
93
+ raise Reactor::NotPermitted, "#{path} lacks neccessary permissions for #{type}"
94
+ end
95
+
96
+ true
98
97
  end
99
98
 
100
99
  def ensure_create_permission_granted(obj_id)
101
- raise RuntimeError, "Permission check for object with id=#{obj_id.inspect} which does not exist" unless RailsConnector::AbstractObj.exists?(obj_id)
102
- raise Reactor::NotPermitted, 'Obj lacks neccessary permissions for creation' unless RailsConnector::AbstractObj.find(obj_id).permission.create_children?
103
- return true
104
- end
100
+ unless RailsConnector::AbstractObj.exists?(obj_id)
101
+ raise "Permission check for object with id=#{obj_id.inspect} which does not exist"
102
+ end
103
+ unless RailsConnector::AbstractObj.find(obj_id).permission.create_children?
104
+ raise Reactor::NotPermitted, "Obj lacks neccessary permissions for creation"
105
+ end
105
106
 
107
+ true
108
+ end
106
109
  end
107
110
 
108
111
  # This class acts as a proxy to underlying permission checking classes.
@@ -111,7 +114,6 @@ module Reactor
111
114
  # 2. Given user has the permission
112
115
  # 3. Given user doesn't have the permission
113
116
  class PermissionProxy
114
-
115
117
  def initialize(obj) #:nodoc:
116
118
  @obj = obj
117
119
  @cache = Reactor::Cache::Permission.instance
@@ -119,7 +121,7 @@ module Reactor
119
121
  end
120
122
 
121
123
  # Returns true if given user (or current user, if none given) has 'live' permission
122
- def live?(user=nil)
124
+ def live?(user = nil)
123
125
  granted?(user, :live)
124
126
  end
125
127
 
@@ -180,7 +182,7 @@ module Reactor
180
182
  def set(permission, groups)
181
183
  identifier = identifier(permission)
182
184
 
183
- groups = [groups] if groups.kind_of?(::String)
185
+ groups = [groups] if groups.is_a?(::String)
184
186
  crul_obj.permission_set(identifier, groups)
185
187
  end
186
188
 
@@ -189,7 +191,7 @@ module Reactor
189
191
  def grant(permission, groups)
190
192
  identifier = identifier(permission)
191
193
 
192
- groups = [groups] if groups.kind_of?(::String)
194
+ groups = [groups] if groups.is_a?(::String)
193
195
  crul_obj.permission_grant(identifier, groups)
194
196
  end
195
197
 
@@ -198,7 +200,7 @@ module Reactor
198
200
  def revoke(permission, groups)
199
201
  identifier = identifier(permission)
200
202
 
201
- groups = [groups] if groups.kind_of?(::String)
203
+ groups = [groups] if groups.is_a?(::String)
202
204
  crul_obj.permission_revoke(identifier, groups)
203
205
  end
204
206
 
@@ -228,7 +230,7 @@ module Reactor
228
230
  end
229
231
  rescue Reactor::Cm::MissingCredentials
230
232
  raise
231
- rescue => e
233
+ rescue StandardError => e
232
234
  Rails.logger.error("Error looking up #{user}'s permission for #{permission} operation on #{obj.path} :\n#{e.message}")
233
235
  false
234
236
  end
@@ -236,11 +238,11 @@ module Reactor
236
238
  # A table with all available permissions and their identifier.
237
239
  def self.permissions
238
240
  @permissions ||= {
239
- :read => 'permissionRead',
240
- :root => 'permissionRoot',
241
- :live => 'permissionLiveServerRead',
242
- :write => 'permissionWrite',
243
- :create_children => 'permissionCreateChildren',
241
+ read: "permissionRead",
242
+ root: "permissionRoot",
243
+ live: "permissionLiveServerRead",
244
+ write: "permissionWrite",
245
+ create_children: "permissionCreateChildren"
244
246
  }
245
247
  end
246
248
 
@@ -263,7 +265,6 @@ module Reactor
263
265
  end
264
266
 
265
267
  class PermissionLookup
266
-
267
268
  def initialize(obj)
268
269
  @obj = obj
269
270
  @cache = Reactor::Cache::User.instance
@@ -290,9 +291,6 @@ module Reactor
290
291
  def user_in_groups(user, groups)
291
292
  groups(user).detect { |user_group| groups.include?(user_group) } != nil
292
293
  end
293
-
294
294
  end
295
-
296
295
  end
297
-
298
296
  end