caboose-cms 0.3.35 → 0.3.36
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjZjMDdhMDcwYTM3MTcxNzVjYWQ1MDZhNTZhOWJmMGNjNGRjYzcwZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzMwZDdjOWVhZDM0ZWI1OTExOTdkZTc3YTIzNmI3NThiMGExY2VkMA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzRlZTI1YmRmZGY1MjdmYzgyZmNmZTRhNWUyYTI5NThiYzllN2QzMmQ3Njg2
|
10
|
+
ZTYyMmUwNmU5ZGExMTk3ODBlMjY2ZTUyMjlkMzBmZmE4YWNjZTZjOWIwMTg3
|
11
|
+
NjRlOTllYzdiMmQzM2Y0N2M2ZDZjODBmMDgyZThiZTUwMGNmYjA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGRhYjgzOTdiYzdiYmUyZWY0NzY1N2ZkYjg4YzMzYWRiYmUxYTNmNzhjZDMx
|
14
|
+
N2MzNzcwZmRiM2RlNWQ4MDc2MjJjMzM0MDU1NDA2OTVkMzM2MjU0ZWIyYzU4
|
15
|
+
YTc1ODUzNTIxNWUxYzM2NDZiMTFlMTg0OWFkNTMxMGVjN2EzYWY=
|
@@ -20,17 +20,17 @@ module Caboose
|
|
20
20
|
end
|
21
21
|
|
22
22
|
user = logged_in_user
|
23
|
-
if
|
24
|
-
if
|
25
|
-
|
23
|
+
if !user.is_allowed(page, 'view')
|
24
|
+
if user.id == User.logged_out_user_id
|
25
|
+
redirect_to "/login?return_url=" + URI.encode(request.fullpath)
|
26
26
|
return
|
27
27
|
else
|
28
28
|
page.title = 'Access Denied'
|
29
|
-
page.content = "<p class='note error'>You do not have access to view this page.</p>"
|
29
|
+
#page.content = "<p class='note error'>You do not have access to view this page.</p>"
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
if
|
33
|
+
if session['use_redirect_urls'] && !page.redirect_url.nil? && page.redirect_url.strip.length > 0
|
34
34
|
redirect_to page.redirect_url
|
35
35
|
return
|
36
36
|
end
|
data/app/models/caboose/page.rb
CHANGED
@@ -26,7 +26,7 @@ class Caboose::Page < ActiveRecord::Base
|
|
26
26
|
:meta_robots, # Multi-select options: none, noindex, nofollow, nosnippet, noodp, noarchive
|
27
27
|
:canonical_url,
|
28
28
|
:facebook_description, # defaults to meta_description
|
29
|
-
:googleplus_description # defaults to meta_description
|
29
|
+
:googleplus_description # defaults to meta_description
|
30
30
|
|
31
31
|
CONTENT_FORMAT_HTML = 1
|
32
32
|
CONTENT_FORMAT_TEXT = 2
|
data/app/models/caboose/role.rb
CHANGED
@@ -46,7 +46,7 @@ class Caboose::Role < ActiveRecord::Base
|
|
46
46
|
for perm in permissions
|
47
47
|
return true if (perm.resource == "all" && perm.action == "all")
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
if (resource.is_a?(Caboose::Page))
|
51
51
|
for perm in page_permissions
|
52
52
|
return true if (perm.page_id == resource.id && perm.action == action)
|
data/app/models/caboose/user.rb
CHANGED
@@ -17,11 +17,10 @@ class Caboose::User < ActiveRecord::Base
|
|
17
17
|
return self.where('username' => 'elo').limit(1).pluck(:id)[0]
|
18
18
|
end
|
19
19
|
|
20
|
-
def is_allowed(resource, action)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
20
|
+
def is_allowed(resource, action)
|
21
|
+
return true if Caboose::Role.where(:name => 'Everyone Logged Out').first.is_allowed(resource, action)
|
22
|
+
for role in roles
|
23
|
+
return true if role.is_allowed(resource, action)
|
25
24
|
end
|
26
25
|
return false;
|
27
26
|
end
|
@@ -14,16 +14,20 @@
|
|
14
14
|
<% end %>
|
15
15
|
|
16
16
|
<% content_for :page_title do %><%= raw @page.title %><% end %>
|
17
|
-
<% content_for :page_content do %><%
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
<% content_for :page_content do %><%
|
18
|
+
if @page.title != 'Access Denied'
|
19
|
+
@page.blocks.each do |b|
|
20
|
+
bt = b.page_block_type
|
21
|
+
if bt.nil?
|
22
|
+
bt = PageBlockType.where(:name => 'heading').first
|
23
|
+
b.page_block_type_id = bt.id
|
24
|
+
b.save
|
25
|
+
end
|
26
|
+
if bt.use_render_function && bt.render_function
|
27
|
+
%><%= raw b.render_from_function(params[:empty_text]) %><%
|
28
|
+
else
|
29
|
+
%><%= render :partial => "caboose/page_blocks/#{bt.name}", :locals => { :block => b, :empty_text => "" } %><%
|
30
|
+
end
|
31
|
+
end
|
23
32
|
end
|
24
|
-
|
25
|
-
%><%= raw b.render_from_function(params[:empty_text]) %><%
|
26
|
-
else
|
27
|
-
%><%= render :partial => "caboose/page_blocks/#{bt.name}", :locals => { :block => b, :empty_text => "" } %><%
|
28
|
-
end
|
29
|
-
end %><% end %>
|
33
|
+
%><% end %>
|
data/lib/caboose/version.rb
CHANGED