lib/role_on.rb in darkhelmet-role_on-0.1.4 vs lib/role_on.rb in darkhelmet-role_on-0.2.0
- old
+ new
@@ -9,10 +9,10 @@
elsif options.include?(:except)
c.class.action_methods.to_a.map(&:intern) - [options[:except]].flatten
else
c.class.action_methods.to_a.map(&:intern)
end
- if restricted_actions.include?(action) && !user_roles.include?(role)
+ if restricted_actions.include?(action) && !user_roles.include?(role) && (options.include?(:sa) ? !user_roles.include?(options[:sa]) : false)
c.send(:access_denied)
false
end
true
end