effective_pages 1.0.15 → 1.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 573e78725bddee6be8f8ebaf63bc2029e788c4e0
4
- data.tar.gz: e25c35be628b91769c9f4bb4d36e96b6bff43a16
3
+ metadata.gz: 6543449c85d8937224c2fbec985df015fbf6f8bc
4
+ data.tar.gz: 0eb293faf55a09912783359463d1470004475bb2
5
5
  SHA512:
6
- metadata.gz: 00e90ad1a8e73f880c823ecd90cef9a7abd3aaeff1abc3cb16e76d44e6ac0bf334d4e6e4264aaa119e596479a44f9a51e1c048ba41c26d14e6a5aec46ce19860
7
- data.tar.gz: 8258f37d1fb159e9e931d7bb111acb71e1a1080fa7cd202b25885f230d0423421463178d16965f2460e737ccf3695f81e371afaa1db40f3d93b57ee4d8857041
6
+ metadata.gz: 5d4e95dc78ee5a48d3dfc6286971acc2c3356a2581cebc6ec37c3b0919e9612eceb6194ff1d4bbab6bfe6bcb1ded5d7644d3c16af28b9f5e7f0f1ef7f4a747ec
7
+ data.tar.gz: 638b2dbfdd8ce783739776ae96745525570afade61d1c4298f56904a299871705ded2d6721b451a0fc396dfc14f5a66dec8c0bc07c4c9bf26c6e98f83b3166f9
data/README.md CHANGED
@@ -403,6 +403,8 @@ can [:show], Effective::Page
403
403
  if user.is?(:admin)
404
404
  can :manage, Effective::Page
405
405
  can :manage, Effective::Menu
406
+
407
+ can :admin, :effective_pages # Can access the admin screens
406
408
  end
407
409
  ```
408
410
 
@@ -10,6 +10,7 @@ module Admin
10
10
  @datatable = Effective::Datatables::Menus.new() if defined?(EffectiveDatatables)
11
11
  @page_title = 'Menus'
12
12
 
13
+ EffectivePages.authorized?(self, :admin, :effective_pages)
13
14
  EffectivePages.authorized?(self, :index, Effective::Menu)
14
15
  end
15
16
 
@@ -17,6 +18,7 @@ module Admin
17
18
  @menu = Effective::Menu.new()
18
19
  @page_title = 'New Menu'
19
20
 
21
+ EffectivePages.authorized?(self, :admin, :effective_pages)
20
22
  EffectivePages.authorized?(self, :new, @menu)
21
23
  end
22
24
 
@@ -24,6 +26,7 @@ module Admin
24
26
  @menu = Effective::Menu.new(menu_params)
25
27
  @page_title = 'New Menu'
26
28
 
29
+ EffectivePages.authorized?(self, :admin, :effective_pages)
27
30
  EffectivePages.authorized?(self, :create, @menu)
28
31
 
29
32
  if @menu.save
@@ -39,6 +42,7 @@ module Admin
39
42
  @menu = Effective::Menu.find(params[:id])
40
43
  @page_title = 'Edit Menu'
41
44
 
45
+ EffectivePages.authorized?(self, :admin, :effective_pages)
42
46
  EffectivePages.authorized?(self, :edit, @menu)
43
47
  end
44
48
 
@@ -46,6 +50,7 @@ module Admin
46
50
  @menu = Effective::Menu.find(params[:id])
47
51
  @page_title = 'Edit Menu'
48
52
 
53
+ EffectivePages.authorized?(self, :admin, :effective_pages)
49
54
  EffectivePages.authorized?(self, :update, @menu)
50
55
 
51
56
  if @menu.update_attributes(menu_params)
@@ -60,6 +65,7 @@ module Admin
60
65
  def destroy
61
66
  @menu = Effective::Menu.find(params[:id])
62
67
 
68
+ EffectivePages.authorized?(self, :admin, :effective_pages)
63
69
  EffectivePages.authorized?(self, :destroy, @menu)
64
70
 
65
71
  if @menu.destroy
@@ -6,6 +6,8 @@ module Admin
6
6
 
7
7
  def index
8
8
  @page_title = 'Pages'
9
+
10
+ EffectivePages.authorized?(self, :admin, :effective_pages)
9
11
  EffectivePages.authorized?(self, :index, Effective::Page)
10
12
 
11
13
  @datatable = Effective::Datatables::Pages.new() if defined?(EffectiveDatatables)
@@ -15,6 +17,7 @@ module Admin
15
17
  @page = Effective::Page.new()
16
18
  @page_title = 'New Page'
17
19
 
20
+ EffectivePages.authorized?(self, :admin, :effective_pages)
18
21
  EffectivePages.authorized?(self, :new, @page)
19
22
  end
20
23
 
@@ -22,6 +25,7 @@ module Admin
22
25
  @page = Effective::Page.new(page_params)
23
26
  @page_title = 'New Page'
24
27
 
28
+ EffectivePages.authorized?(self, :admin, :effective_pages)
25
29
  EffectivePages.authorized?(self, :create, @page)
26
30
 
27
31
  if @page.save
@@ -43,6 +47,7 @@ module Admin
43
47
  @page = Effective::Page.find(params[:id])
44
48
  @page_title = 'Edit Page'
45
49
 
50
+ EffectivePages.authorized?(self, :admin, :effective_pages)
46
51
  EffectivePages.authorized?(self, :edit, @page)
47
52
  end
48
53
 
@@ -50,6 +55,7 @@ module Admin
50
55
  @page = Effective::Page.find(params[:id])
51
56
  @page_title = 'Edit Page'
52
57
 
58
+ EffectivePages.authorized?(self, :admin, :effective_pages)
53
59
  EffectivePages.authorized?(self, :update, @page)
54
60
 
55
61
  if @page.update_attributes(page_params)
@@ -70,6 +76,7 @@ module Admin
70
76
  def destroy
71
77
  @page = Effective::Page.find(params[:id])
72
78
 
79
+ EffectivePages.authorized?(self, :admin, :effective_pages)
73
80
  EffectivePages.authorized?(self, :destroy, @page)
74
81
 
75
82
  if @page.destroy
@@ -1,3 +1,3 @@
1
1
  module EffectivePages
2
- VERSION = '1.0.15'.freeze
2
+ VERSION = '1.0.16'.freeze
3
3
  end
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: 1.0.15
4
+ version: 1.0.16
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: 2016-10-03 00:00:00.000000000 Z
11
+ date: 2016-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails