caboose-cms 0.5.182 → 0.5.183
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 +8 -8
- data/app/controllers/caboose/sites_controller.rb +12 -12
- data/app/models/caboose/core_plugin.rb +1 -1
- data/app/models/caboose/schema.rb +2 -1
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTg4NGZmMzU2MGY0NTcxOTAwODc0NDA1MzI2MThiMTc2YzQ1ZDI0Yw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTk2NGI5NDJlZTIzOGRiMzcxODA0ZDYzZWU0YzAxZWY3ZGFhMWExZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTgxYWQ1ZjQ4ZTRhN2QzNTRmYWVhMzAxZTUwYzUzNGRmMTA1MTc4MTk1NTFh
|
10
|
+
NTdkMzdmMGVjMjgzYmM3N2QzOTI5ZGRkODA5ZjI0NzY5Nzc0OTljNDFkMTc0
|
11
|
+
NTBkNzM0ODk4ZWI1MzYyZDI0YjZmZGU3ZWU5Yzk2YWQ1YWZmYTM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTI4NDYzMzM5ZjcwOTU5YzFjZGY2MTg3Yjg0Y2Q4ZThhM2RjNjczYWE2NmY1
|
14
|
+
MjU3Y2M5YWZkMDFiMGM0MzFmMDNiZGI2NjI2M2E5NmM1MTZiM2VmMjU2OTNj
|
15
|
+
MmM5NjQ2YTE3NjM5YTk4NjIxN2MzZDdjMjVlZmQ1NmUyOTRiY2U=
|
@@ -11,7 +11,7 @@ module Caboose
|
|
11
11
|
# GET /admin/sites
|
12
12
|
def admin_index
|
13
13
|
return if !user_is_allowed('sites', 'view')
|
14
|
-
if
|
14
|
+
if !@site.is_master
|
15
15
|
@error = "You are not allowed to manage sites."
|
16
16
|
render :file => 'caboose/extras/error' and return
|
17
17
|
end
|
@@ -31,7 +31,7 @@ module Caboose
|
|
31
31
|
# GET /admin/sites/new
|
32
32
|
def admin_new
|
33
33
|
return if !user_is_allowed('sites', 'add')
|
34
|
-
if
|
34
|
+
if !@site.is_master
|
35
35
|
@error = "You are not allowed to manage sites."
|
36
36
|
render :file => 'caboose/extras/error' and return
|
37
37
|
end
|
@@ -42,7 +42,7 @@ module Caboose
|
|
42
42
|
# GET /admin/sites/:id
|
43
43
|
def admin_edit
|
44
44
|
return if !user_is_allowed('sites', 'edit')
|
45
|
-
if
|
45
|
+
if !@site.is_master
|
46
46
|
@error = "You are not allowed to manage sites."
|
47
47
|
render :file => 'caboose/extras/error' and return
|
48
48
|
end
|
@@ -64,7 +64,7 @@ module Caboose
|
|
64
64
|
# GET /admin/sites/:id/block-types
|
65
65
|
def admin_edit_block_types
|
66
66
|
return if !user_is_allowed('sites', 'edit')
|
67
|
-
if
|
67
|
+
if !@site.is_master
|
68
68
|
@error = "You are not allowed to manage sites."
|
69
69
|
render :file => 'caboose/extras/error' and return
|
70
70
|
end
|
@@ -75,7 +75,7 @@ module Caboose
|
|
75
75
|
# GET /admin/sites/:id/delete
|
76
76
|
def admin_delete_form
|
77
77
|
return if !user_is_allowed('sites', 'edit')
|
78
|
-
if
|
78
|
+
if !@site.is_master
|
79
79
|
@error = "You are not allowed to manage sites."
|
80
80
|
render :file => 'caboose/extras/error' and return
|
81
81
|
end
|
@@ -85,7 +85,7 @@ module Caboose
|
|
85
85
|
# POST /admin/sites
|
86
86
|
def admin_add
|
87
87
|
return if !user_is_allowed('sites', 'add')
|
88
|
-
render :json => { :error => "You are not allowed to manage sites." } and return if
|
88
|
+
render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
|
89
89
|
|
90
90
|
resp = StdClass.new
|
91
91
|
site = Site.new
|
@@ -117,7 +117,7 @@ module Caboose
|
|
117
117
|
# PUT /admin/sites/:id
|
118
118
|
def admin_update
|
119
119
|
return if !user_is_allowed('sites', 'edit')
|
120
|
-
render :json => { :error => "You are not allowed to manage sites." } and return if
|
120
|
+
render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
|
121
121
|
|
122
122
|
resp = StdClass.new
|
123
123
|
site = Site.find(params[:id])
|
@@ -139,7 +139,7 @@ module Caboose
|
|
139
139
|
# POST /admin/sites/:id/logo
|
140
140
|
def admin_update_logo
|
141
141
|
return if !user_is_allowed('sites', 'edit')
|
142
|
-
render :json => { :error => "You are not allowed to manage sites." } and return if
|
142
|
+
render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
|
143
143
|
|
144
144
|
site = Site.find(params[:id])
|
145
145
|
site.logo = params[:logo]
|
@@ -154,7 +154,7 @@ module Caboose
|
|
154
154
|
# DELETE /admin/sites/:id
|
155
155
|
def admin_delete
|
156
156
|
return if !user_is_allowed('sites', 'delete')
|
157
|
-
render :json => { :error => "You are not allowed to manage sites." } and return if
|
157
|
+
render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
|
158
158
|
|
159
159
|
site = Site.find(params[:id])
|
160
160
|
site.destroy
|
@@ -168,7 +168,7 @@ module Caboose
|
|
168
168
|
# POST /admin/sites/:id/members
|
169
169
|
def admin_add_member
|
170
170
|
return if !user_is_allowed('sites', 'edit')
|
171
|
-
render :json => { :error => "You are not allowed to manage sites." } and return if
|
171
|
+
render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
|
172
172
|
|
173
173
|
sm = SiteMembership.where(:site_id => params[:id], :user_id => params[:user_id]).first
|
174
174
|
sm = SiteMembership.create(:site_id => params[:id], :user_id => params[:user_id]) if sm.nil?
|
@@ -180,7 +180,7 @@ module Caboose
|
|
180
180
|
# DELETE /admin/sites/:id/members/:user_id
|
181
181
|
def admin_remove_member
|
182
182
|
return if !user_is_allowed('sites', 'edit')
|
183
|
-
render :json => { :error => "You are not allowed to manage sites." } and return if
|
183
|
+
render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
|
184
184
|
|
185
185
|
SiteMembership.where(:site_id => params[:id], :user_id => params[:user_id]).destroy_all
|
186
186
|
render :json => true
|
@@ -189,7 +189,7 @@ module Caboose
|
|
189
189
|
# GET /admin/sites/options
|
190
190
|
def options
|
191
191
|
return if !user_is_allowed('sites', 'view')
|
192
|
-
render :json => { :error => "You are not allowed to manage sites." } and return if
|
192
|
+
render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
|
193
193
|
|
194
194
|
options = Site.reorder('name').all.collect { |s| { 'value' => s.id, 'text' => s.name }}
|
195
195
|
render :json => options
|
@@ -12,7 +12,7 @@ class Caboose::CorePlugin < Caboose::CaboosePlugin
|
|
12
12
|
item['children'] << { 'id' => 'redirects' , 'text' => 'Permanent Redirects' , 'href' => '/admin/redirects' , 'modal' => false } if user.is_allowed('redirects' , 'view')
|
13
13
|
item['children'] << { 'id' => 'permissions' , 'text' => 'Permissions' , 'href' => '/admin/permissions' , 'modal' => false } if user.is_allowed('permissions' , 'view')
|
14
14
|
item['children'] << { 'id' => 'roles' , 'text' => 'Roles' , 'href' => '/admin/roles' , 'modal' => false } if user.is_allowed('roles' , 'view')
|
15
|
-
item['children'] << { 'id' => 'sites' , 'text' => 'Sites' , 'href' => '/admin/sites' , 'modal' => false } if user.is_allowed('sites' , 'view') if site.
|
15
|
+
item['children'] << { 'id' => 'sites' , 'text' => 'Sites' , 'href' => '/admin/sites' , 'modal' => false } if user.is_allowed('sites' , 'view') if site.is_master == true
|
16
16
|
item['children'] << { 'id' => 'smtp' , 'text' => 'SMTP (Mail)' , 'href' => '/admin/smtp' , 'modal' => false } if user.is_allowed('smtp' , 'view')
|
17
17
|
item['children'] << { 'id' => 'social' , 'text' => 'Social Media' , 'href' => '/admin/social' , 'modal' => false } if user.is_allowed('social' , 'view')
|
18
18
|
item['children'] << { 'id' => 'store' , 'text' => 'Store' , 'href' => '/admin/store' , 'modal' => false } if user.is_allowed('store' , 'view')
|
@@ -567,7 +567,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
567
567
|
[ :description , :text ],
|
568
568
|
[ :under_construction_html , :text ],
|
569
569
|
[ :use_store , :boolean , { :default => false }],
|
570
|
-
[ :logo , :attachment ]
|
570
|
+
[ :logo , :attachment ],
|
571
|
+
[ :is_master , :boolean , { :default => false }]
|
571
572
|
],
|
572
573
|
Caboose::SiteMembership => [
|
573
574
|
[ :site_id , :integer ],
|
data/lib/caboose/version.rb
CHANGED