effective_pages 3.0.6 → 3.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/page.rb +1 -2
- data/app/views/effective/pages/_menu.html.haml +2 -2
- data/config/routes.rb +2 -0
- 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: 7451b8d10bc65dccbcc9d6927b5c76eaa917378b6725fd887e3509a7d39369fe
|
4
|
+
data.tar.gz: e0a7a32e358dd7009ba7f4801dd163422b67b653eb62037a06a6f97c4dcebe43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca28a3a998012976cfcef1773eac6f9d673ec22bcece7ab74fa2fd4812a9720de9b6648e05e1af1906d5ca80454910a0c0fb08d0e586cc2d606a748919887078
|
7
|
+
data.tar.gz: '0249e9d861efc9922fd998ce55685714e1f2890658b3b431a96d9c209a8133e19ccb6e4fddfc63d6f8d9da7c9f8bacc6fbf933aed2f51a65b08248c9399b247c'
|
@@ -59,8 +59,7 @@ module Effective
|
|
59
59
|
validates :layout, presence: true
|
60
60
|
validates :template, presence: true
|
61
61
|
|
62
|
-
validates :menu_name, if: -> { menu? && EffectivePages.menus.present? },
|
63
|
-
presence: true, inclusion: { in: EffectivePages.menus.map(&:to_s) }
|
62
|
+
validates :menu_name, if: -> { menu? && EffectivePages.menus.present? }, presence: true
|
64
63
|
|
65
64
|
# validates :menu_position, if: -> { menu? },
|
66
65
|
# presence: true, uniqueness: { scope: [:menu_name, :menu_parent_id] }
|
@@ -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
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.9
|
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-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|