caboose-cms 0.9.169 → 0.9.170

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac49e4d947611b1b63d9e5c5c6ff35ee503cc460
4
- data.tar.gz: 74c08e61efc772e49ced1f3010575376c5afe6bc
3
+ metadata.gz: c121572fe7fa94e41fa2e83034b8751b09db5780
4
+ data.tar.gz: cda1f7ab16cf092667cd648cd3687f91deef4033
5
5
  SHA512:
6
- metadata.gz: 244aabfe1907aa28c22280cfc72abdc8cae581181da87a9401f6fe650d0d3852b85b8e543b62439017997647f608d3f77a7732f05fef915aa77ed5ad76d6fa9c
7
- data.tar.gz: 3a2a4494f35fbc92cc3cad249d6280a765951b696112d2690d9081486f2f31ada0454ac3acde0c3149cfeecb9f40a8bfb6d2ef4f6e1fb09c783afcce7bc2c8ec
6
+ metadata.gz: c4827e40c82dd96eb8741960722451a2904f3c0e13961f375b73eccb0a85192f870e31e7b6a94f4fed85ffd0cabda6ccff216db9e279fa203e34e851f96bf353
7
+ data.tar.gz: 4c7b333e238e5ac3d1df26f6217ff5398b2c8fb36b2a1f51dce38b6f33e26eea2eaf44baaa6be6978af850a5312386901c11e7862490400f5502513cdd8bafd2
@@ -73,6 +73,7 @@ class Caboose::Theme < ActiveRecord::Base
73
73
  :digest
74
74
 
75
75
  def compile(for_site_id = 0)
76
+ Caboose.log("compiling theme for site #{for_site_id}")
76
77
  theme = self
77
78
  theme_name = 'default'
78
79
  path = Rails.root.join('themes', "#{theme_name}.scss.erb")
@@ -81,7 +82,7 @@ class Caboose::Theme < ActiveRecord::Base
81
82
  tmp_asset_name = "theme_#{self.id}_site_#{for_site_id}"
82
83
  FileUtils.mkdir_p(tmp_themes_path) unless File.directory?(tmp_themes_path)
83
84
  File.open(File.join(tmp_themes_path, "#{tmp_asset_name}.scss"), 'w') { |f| f.write(body) }
84
- begin
85
+ # begin
85
86
  env = if Rails.application.assets.is_a?(Sprockets::Index)
86
87
  Rails.application.assets.instance_variable_get('@environment')
87
88
  else
@@ -101,15 +102,14 @@ class Caboose::Theme < ActiveRecord::Base
101
102
  bucket = AWS::S3.new.buckets[config['bucket']]
102
103
  bucket.objects[theme.asset_path(asset.digest, for_site_id)].write(str, :acl => 'public-read', :content_type => 'text/css')
103
104
  else
104
- Caboose.log("creating themes folder if doesn't exist")
105
105
  theme_path = File.join(Rails.root, 'public', 'assets', 'themes')
106
106
  FileUtils.mkdir_p(theme_path) unless File.directory?(theme_path)
107
107
  File.open(File.join(Rails.root, 'public', theme.asset_path(asset.digest, for_site_id)), 'w') { |f| f.write(compressed_body) }
108
108
  end
109
109
  self.update_digest(asset.digest)
110
- rescue Sass::SyntaxError => error
111
- theme.revert
112
- end
110
+ # rescue Sass::SyntaxError => error
111
+ # theme.revert
112
+ # end
113
113
  end
114
114
 
115
115
  def revert
@@ -49,25 +49,40 @@ class Caboose::User < ActiveRecord::Base
49
49
  def forem_email
50
50
  self.email
51
51
  end
52
-
53
- def is_allowed(resource, action)
54
- if self.username == 'elo'
55
- elo = Caboose::Role.logged_out_role(self.site_id)
56
- elo_is_allowed = elo.is_allowed(resource, action)
57
- return true if elo_is_allowed
58
- return false if !elo_is_allowed && self.is_logged_out_user?
59
- eli = Caboose::Role.logged_in_role(self.site_id)
60
- return true if self.id != elo.id && eli.is_allowed(resource, action)
61
- else
62
- for role in roles
63
- if role.is_allowed(resource, action)
64
- return true
65
- end
52
+
53
+ def is_allowed(resource, action)
54
+ elo = Caboose::Role.logged_out_role(self.site_id)
55
+ elo_is_allowed = elo.is_allowed(resource, action)
56
+ return true if elo_is_allowed
57
+ return false if !elo_is_allowed && self.is_logged_out_user?
58
+ eli = Caboose::Role.logged_in_role(self.site_id)
59
+ return true if self.id != elo.id && eli.is_allowed(resource, action)
60
+ for role in roles
61
+ if role.is_allowed(resource, action)
62
+ return true
66
63
  end
67
64
  end
68
65
  return false
69
66
  end
70
67
 
68
+ # def is_allowed(resource, action)
69
+ # if self.username == 'elo'
70
+ # elo = Caboose::Role.logged_out_role(self.site_id)
71
+ # elo_is_allowed = elo.is_allowed(resource, action)
72
+ # return true if elo_is_allowed
73
+ # return false if !elo_is_allowed && self.is_logged_out_user?
74
+ # eli = Caboose::Role.logged_in_role(self.site_id)
75
+ # return true if self.id != elo.id && eli.is_allowed(resource, action)
76
+ # else
77
+ # for role in roles
78
+ # if role.is_allowed(resource, action)
79
+ # return true
80
+ # end
81
+ # end
82
+ # end
83
+ # return false
84
+ # end
85
+
71
86
  def self.validate_token(token)
72
87
  user = self.where('token' => token).first
73
88
  return user
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.169'
2
+ VERSION = '0.9.170'
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.9.169
4
+ version: 0.9.170
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry