role_authorization 0.4.2 → 0.4.3

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.
@@ -98,13 +98,11 @@ module RoleAuthorization
98
98
  end
99
99
 
100
100
  if hash
101
- controller_klass = if self.controller_name == hash[:controller]
102
- klass = (hash[:controller].camelize + "Controller").constantize.new
103
- klass.params = hash
104
- klass
105
- end
101
+ klass = (hash[:controller].camelize + "Controller").constantize.new
102
+ klass.params = hash
103
+ klass.instance_variable_set(:@current_user, current_user)
106
104
 
107
- return authorized_action?(controller_klass, hash[:controller], hash[:action].to_sym, hash[:id])
105
+ return authorized_action?(klass, hash[:controller], hash[:action].to_sym, hash[:id])
108
106
  end
109
107
  rescue Exception => e
110
108
  Rails.logger.error e.inspect
@@ -1,3 +1,3 @@
1
1
  module RoleAuthorization
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: role_authorization
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.2
5
+ version: 0.4.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - John 'asceth' Long