petergate 1.6.5 → 1.6.6

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: 2d20c92ae2ae79dfbb8f1c9d834cc6de6e708036
4
- data.tar.gz: 722b9be598ba7734931ec5c7bb3011527a926879
3
+ metadata.gz: 92093289b85646356446c4fcaff0d86c28f3142f
4
+ data.tar.gz: 8a48aebdd93d07ab8e452e7ddd60758c0692f4ac
5
5
  SHA512:
6
- metadata.gz: c8fc4379359203634b97750673bd21d3f88dbeff336a44b2c39b68a427a477faff622379aaff828c445d8a46db596781ffe90e872a26369948a8eab50250cffa
7
- data.tar.gz: 3a0bf6453f83ec508a009d6a5c757bd24b1481e4cee23dbee62b90ec65a360f1cf1aff0ed86543b2a3e3b74c0b5d925055795e40f7509a2273f3c034f272302e
6
+ metadata.gz: 61da71bb4c55f95776c2495fa5f2a7776fa66db45b566ee0e401ec0673f3d2f9bf19680708d7fe999baa51cd56bd303002170f679f107562721c7c1d888ee799
7
+ data.tar.gz: fc9f0361a82da2a106730e65d02e31ebd334f2d354326e61bfc7a7d8931a91103fc0a21b7113907ccc040b11082a27a9e27929355d232feb25327d2891eecbe6
@@ -41,6 +41,19 @@ module Petergate
41
41
  subclass.instance_variable_set("@_controller_rules", instance_variable_get("@_controller_rules"))
42
42
  subclass.instance_variable_set("@_controller_message", instance_variable_get("@_controller_message"))
43
43
  end
44
+
45
+ before_action do
46
+ unless logged_in?(:root_admin)
47
+ message= defined?(check_access) ? check_access : true
48
+ if message == false || message.is_a?(String)
49
+ if current_user || @user
50
+ forbidden! message
51
+ else
52
+ unauthorized!
53
+ end
54
+ end
55
+ end
56
+ end
44
57
  end
45
58
 
46
59
  class_eval do
@@ -56,18 +69,6 @@ module Petergate
56
69
  def self.included(base)
57
70
  base.extend(ClassMethods)
58
71
  base.helper_method :logged_in?, :forbidden!
59
- base.before_action do
60
- unless logged_in?(:root_admin)
61
- message= defined?(check_access) ? check_access : true
62
- if message == false || message.is_a?(String)
63
- if current_user || @user
64
- forbidden! message
65
- else
66
- unauthorized!
67
- end
68
- end
69
- end
70
- end
71
72
  end
72
73
 
73
74
  def parse_permission_rules(rules)
@@ -1,3 +1,3 @@
1
1
  module Petergate
2
- VERSION = "1.6.5"
2
+ VERSION = "1.6.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: petergate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.5
4
+ version: 1.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Sloan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-04 00:00:00.000000000 Z
11
+ date: 2016-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler