incline 0.2.16 → 0.2.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/app/models/incline/action_security.rb +24 -5
- data/app/views/incline/security/_list.html.erb +11 -1
- data/lib/incline/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26b57eeb71154ecd78ca518cff42f4611b83039d
|
4
|
+
data.tar.gz: deaf5ce2ff1810f725b928d00aec489e80e63a76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b1350992064923d07dbdd0de0257ebbe98f9bf308a62b5b35d3dbe36dfd9c90f905fb1b18d16009ba82b4ee7438eb090820c4c80424a3698bd240cb58a96917
|
7
|
+
data.tar.gz: 25bc635ab9533868136a17239a0141ab7922d74f814eb11a99de455055334b04cbcbf052cfab22b7906c9b88be7c08bcbf06f68498fec9cfae78acf6b40d7d0c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
incline (0.2.
|
4
|
+
incline (0.2.17)
|
5
5
|
ansi (~> 1.5.0)
|
6
6
|
bcrypt
|
7
7
|
bootstrap-sass
|
@@ -58,7 +58,7 @@ GEM
|
|
58
58
|
tzinfo (~> 1.1)
|
59
59
|
ansi (1.5.0)
|
60
60
|
arel (6.0.4)
|
61
|
-
autoprefixer-rails (7.1.
|
61
|
+
autoprefixer-rails (7.1.5)
|
62
62
|
execjs
|
63
63
|
bcrypt (3.1.11)
|
64
64
|
bootstrap-sass (3.3.7)
|
@@ -140,7 +140,7 @@ GEM
|
|
140
140
|
redcarpet (3.4.0)
|
141
141
|
rubyserial (0.4.0)
|
142
142
|
ffi (~> 1.9, >= 1.9.3)
|
143
|
-
sass (3.5.
|
143
|
+
sass (3.5.2)
|
144
144
|
sass-listen (~> 4.0.0)
|
145
145
|
sass-listen (4.0.0)
|
146
146
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
@@ -109,20 +109,39 @@ module Incline
|
|
109
109
|
@valid_items = nil if refresh
|
110
110
|
@valid_items ||=
|
111
111
|
begin
|
112
|
-
|
112
|
+
# remove all paths and set all items to hidden.
|
113
|
+
Incline::ActionSecurity.update_all(visible: false, path: '#')
|
113
114
|
|
114
115
|
ret = Incline
|
115
116
|
.route_list
|
116
|
-
.reject{|r| r[:action]
|
117
|
+
.reject{|r| %w(api locate).include?(r[:action]) }
|
117
118
|
.map do |r|
|
119
|
+
|
118
120
|
item = ActionSecurity.find_or_initialize_by(controller_name: r[:controller], action_name: r[:action])
|
119
|
-
|
121
|
+
|
122
|
+
# ensure the current path is set to the item.
|
123
|
+
item_path = "#{r[:path]} [#{r[:verb]}]"
|
124
|
+
if item.path == '#' || item.path.blank?
|
125
|
+
item.path = item_path
|
126
|
+
# only update the flags once if the path has not yet been set.
|
127
|
+
item.update_flags if update_flags
|
128
|
+
elsif !item.path.include?(item_path)
|
129
|
+
item.path += "\n" + item_path
|
130
|
+
end
|
131
|
+
|
132
|
+
# re-sort the path list and make the item visible.
|
133
|
+
item.path = item.path.split("\n").sort.join("\n")
|
120
134
|
item.visible = true
|
121
|
-
|
135
|
+
|
122
136
|
item.save!
|
123
137
|
item
|
138
|
+
end.sort do |a,b|
|
139
|
+
if a.controller_name == b.controller_name
|
140
|
+
a.action_name <=> b.action_name
|
141
|
+
else
|
142
|
+
a.controller_name <=> b.controller_name
|
143
|
+
end
|
124
144
|
end
|
125
|
-
.sort{|a,b| a.controller_name == b.controller_name ? a.action_name <=> b.action_name : a.controller_name <=> b.controller_name}
|
126
145
|
|
127
146
|
def ret.[](*args)
|
128
147
|
if args.length == 2
|
@@ -41,7 +41,17 @@
|
|
41
41
|
{
|
42
42
|
data: 'path',
|
43
43
|
orderable: true,
|
44
|
-
searchable: true
|
44
|
+
searchable: true,
|
45
|
+
render: function(data, type, row, meta) {
|
46
|
+
if (type === 'display')
|
47
|
+
{
|
48
|
+
return data.replace(/\n/g, '<br>');
|
49
|
+
}
|
50
|
+
else
|
51
|
+
{
|
52
|
+
return data;
|
53
|
+
}
|
54
|
+
}
|
45
55
|
},
|
46
56
|
{
|
47
57
|
data: 'controller_name',
|
data/lib/incline/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: incline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Beau Barker
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|