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
- NTFmOTRhYmFjNWE2YjA4N2Y3ZWM2MTlmMmZlNmI4MGU1ODE2OTJhNQ==
4
+ MjZjMDdhMDcwYTM3MTcxNzVjYWQ1MDZhNTZhOWJmMGNjNGRjYzcwZQ==
5
5
  data.tar.gz: !binary |-
6
- YTdkZDFkZTgxYzk3ZWQzZGQzN2ZmNjcwM2UxMjg0OTcxZjgyNmNlMA==
6
+ NzMwZDdjOWVhZDM0ZWI1OTExOTdkZTc3YTIzNmI3NThiMGExY2VkMA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Mzc4MjAyYmY3ZjljYzE3OGI3ZWM4NTVlNTkwODY5ZjQ4N2Q4MTI1YzhmODNj
10
- NTk0Njg4MDE4NWE4YWY1YzZlZjk3YmUwOWEyYzJiNTVmMDg1MTI0OGJlZTdj
11
- YWRiMjU3MmI3YWYwZTg3M2M4MDFiY2IyMDkxZmRjNDQ0Y2RkZmY=
9
+ MzRlZTI1YmRmZGY1MjdmYzgyZmNmZTRhNWUyYTI5NThiYzllN2QzMmQ3Njg2
10
+ ZTYyMmUwNmU5ZGExMTk3ODBlMjY2ZTUyMjlkMzBmZmE4YWNjZTZjOWIwMTg3
11
+ NjRlOTllYzdiMmQzM2Y0N2M2ZDZjODBmMDgyZThiZTUwMGNmYjA=
12
12
  data.tar.gz: !binary |-
13
- MjU0OWE4MTc1MjNhMjgwYTNkMzg5NzIwZmM0MzMzZmQzOTk4NmZjMTA2NWUz
14
- YTZmMGEwYTk4ZGI2NDk2MWY5NzllNGU4YTE4NDNmODRhODc0NDI4Mzk5Yzk3
15
- YzdhMDJlYjExOGNiMzYxMjUzNzgwZTFhMTA5MzBlZmIyZjg4ZWU=
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 (!user.is_allowed(page, 'view'))
24
- if (user.id == User.logged_out_user_id)
25
- redirect_to "/login?return_url=" + URI.encode(request.fullpath)
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 (session['use_redirect_urls'] && !page.redirect_url.nil? && page.redirect_url.strip.length > 0)
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
@@ -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
@@ -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)
@@ -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
- for role in roles
22
- if role.is_allowed(resource, action)
23
- return true
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 %><% @page.blocks.each do |b|
18
- bt = b.page_block_type
19
- if bt.nil?
20
- bt = PageBlockType.where(:name => 'heading').first
21
- b.page_block_type_id = bt.id
22
- b.save
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
- if bt.use_render_function && bt.render_function
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 %>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.3.35'
2
+ VERSION = '0.3.36'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.35
4
+ version: 0.3.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry