classiccms 0.6.8 → 0.6.9
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.
- data/lib/classiccms/helpers.rb +5 -5
- data/lib/classiccms/version.rb +1 -1
- metadata +2 -2
data/lib/classiccms/helpers.rb
CHANGED
@@ -8,14 +8,14 @@ module Classiccms
|
|
8
8
|
|
9
9
|
#insert the header for CMS to work
|
10
10
|
def cms
|
11
|
-
if @user != nil and @user.admin?
|
11
|
+
if @user != nil and @user.admin?(@routes)
|
12
12
|
show :header, views: File.join(Classiccms::ROOT, 'views/cms')
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
#insert the logout button
|
17
17
|
def logout
|
18
|
-
if @user != nil and @user.admin?
|
18
|
+
if @user != nil and @user.admin?(@routes)
|
19
19
|
show :logout, views: File.join(Classiccms::ROOT, 'views/cms')
|
20
20
|
end
|
21
21
|
end
|
@@ -92,7 +92,7 @@ module Classiccms
|
|
92
92
|
item[1] = get_parent_id(item[1])
|
93
93
|
end
|
94
94
|
end
|
95
|
-
if @user != nil and @user.admin?
|
95
|
+
if @user != nil and @user.admin?(@routes)
|
96
96
|
info = Base64.encode64(items.to_s.encrypt)
|
97
97
|
show :add, {views: File.join(Classiccms::ROOT, 'views/cms')}, {encrypteddata: info}
|
98
98
|
end
|
@@ -101,7 +101,7 @@ module Classiccms
|
|
101
101
|
#returns the html for edit button
|
102
102
|
def edit(id)
|
103
103
|
records = Base.where(_id: id)
|
104
|
-
if records.count > 0 and @user != nil and @user.admin?
|
104
|
+
if records.count > 0 and @user != nil and @user.admin?(@routes)
|
105
105
|
info = Base64.encode64 records.first.id.to_s.encrypt
|
106
106
|
|
107
107
|
show :edit, {views: File.join(Classiccms::ROOT, 'views/cms')}, {encrypteddata: info}
|
@@ -113,7 +113,7 @@ module Classiccms
|
|
113
113
|
if object.kind_of? Moped::BSON::ObjectId or object.kind_of? String
|
114
114
|
object = Base.where(:_id => object).first
|
115
115
|
end
|
116
|
-
if @user != nil and @user.admin?
|
116
|
+
if @user != nil and @user.admin?(@routes)
|
117
117
|
object.id.to_s
|
118
118
|
end
|
119
119
|
end
|
data/lib/classiccms/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: classiccms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|