effective_pages 3.0.7 → 3.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/effective/pages/_menu.html.haml +2 -2
- data/config/routes.rb +2 -0
- data/lib/effective_pages/engine.rb +5 -3
- data/lib/effective_pages/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce5bc87bbf145bfcf88dfcf9b5efb9ab778876b4d103cc0a2b2cabfbae9f0f05
|
4
|
+
data.tar.gz: 613c1b974148fd8f0b31bcd204ce5cbd979545baf09d08468f9bb44f21ee4ab5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51e0ba41ee3f97be0fe574b4cd017ba47fe3421e0d7827c0d1fad8522f4d1194ff8dc4e7c721c06d4d0b84b8414ba31a201ccea0ced2ae5dbc43148f1512b216
|
7
|
+
data.tar.gz: 7ff18a08e8d591bc473609244604b73bd8f24a42cccf579492db53d24fb536b7e6c460f36718ea35fa59693ba9aa437fab6806c02e6729565a4330d1cbaf4e42
|
@@ -4,7 +4,7 @@
|
|
4
4
|
- Effective::Page.for_menu_root(menu).each do |page|
|
5
5
|
- next unless EffectiveResources.authorized?(self, :show, page)
|
6
6
|
- next if (page.authenticate_user || page.roles.present?) && current_user.blank?
|
7
|
-
- next if page.roles.present? &&
|
7
|
+
- next if page.roles.present? && (current_user.roles & page.roles).blank?
|
8
8
|
|
9
9
|
- menu_children = page.menu_children.select { |page| page.menu_name == menu }
|
10
10
|
|
@@ -15,6 +15,6 @@
|
|
15
15
|
- menu_children.each do |page|
|
16
16
|
- next unless EffectiveResources.authorized?(self, :show, page)
|
17
17
|
- next if (page.authenticate_user || page.roles.present?) && current_user.blank?
|
18
|
-
- next if page.roles.present? &&
|
18
|
+
- next if page.roles.present? && (current_user.roles & page.roles).blank?
|
19
19
|
|
20
20
|
= nav_link_to((page.menu_title.presence || page.title), (page.menu_url.presence || effective_pages.page_path(page)))
|
data/config/routes.rb
CHANGED
@@ -4,9 +4,11 @@ module EffectivePages
|
|
4
4
|
|
5
5
|
# Include Helpers to base application
|
6
6
|
initializer 'effective_pages.action_controller' do |app|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
app.config.to_prepare do
|
8
|
+
ActiveSupport.on_load :action_controller_base do
|
9
|
+
helper EffectivePagesHelper
|
10
|
+
helper EffectiveMenusHelper
|
11
|
+
end
|
10
12
|
end
|
11
13
|
end
|
12
14
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|