social_stream-base 0.9.29 → 0.9.30
Sign up to get free protection for your applications and to get access to all the features.
data/lib/social_stream/base.rb
CHANGED
@@ -25,10 +25,6 @@ module SocialStream
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
initializer "social_stream-base.cancan_devise_integration" do
|
29
|
-
ApplicationController.rescue_handlers += [["CanCan::AccessDenied", :rescue_from_access_denied]]
|
30
|
-
end
|
31
|
-
|
32
28
|
initializer "social_stream-base.toolbar_config" do
|
33
29
|
SocialStream::ToolbarConfig.module_eval do
|
34
30
|
include SocialStream::ToolbarConfig::Base
|
@@ -52,6 +48,10 @@ module SocialStream
|
|
52
48
|
config.email_method = :mailboxer_email
|
53
49
|
end
|
54
50
|
end
|
51
|
+
|
52
|
+
config.to_prepare do
|
53
|
+
ApplicationController.rescue_handlers += [["CanCan::AccessDenied", :rescue_from_access_denied]]
|
54
|
+
end
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
@@ -10,8 +10,10 @@ module SocialStream
|
|
10
10
|
|
11
11
|
# Redirect to login if the user is trying to access a protected resource
|
12
12
|
# and she is not authenticated
|
13
|
-
def rescue_from_access_denied
|
14
|
-
|
13
|
+
def rescue_from_access_denied(exception)
|
14
|
+
if user_signed_in?
|
15
|
+
raise exception
|
16
|
+
else
|
15
17
|
redirect_to new_user_session_path
|
16
18
|
end
|
17
19
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 30
|
10
|
+
version: 0.9.30
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- GING - DIT - UPM
|