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 +4 -4
- data/lib/petergate/action_controller/base.rb +13 -12
- data/lib/petergate/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: 92093289b85646356446c4fcaff0d86c28f3142f
|
4
|
+
data.tar.gz: 8a48aebdd93d07ab8e452e7ddd60758c0692f4ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
data/lib/petergate/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|