petergate 1.8.1 → 1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/lib/petergate/action_controller/base.rb +5 -1
- 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: fe88ac6321fea2180fa92791c94b3cca920e6d52
|
4
|
+
data.tar.gz: 751cbbe03fa230735fdd3ded6468b078ea8d1e0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9be1294fae6e009199f85b42cf774c9ba272a7ddbaf0904c673fe21ea0f3307d6f5c6e78a8d21a190cc88544227cc7d73f42f1d74bbf9c9ccae8feb18396e4ab
|
7
|
+
data.tar.gz: be77842329cb0f71881b9f149110e8be1ac9f90f36804532c9fa68575cc3c0df297dede637d3b577a9bea21938835a8453db8ab7f3c3033ab8329120b1a58a36
|
data/README.md
CHANGED
@@ -33,7 +33,6 @@ and called User.
|
|
33
33
|
|
34
34
|
If you're using [devise](https://github.com/plataformatec/devise) you're in luck, otherwise you'll have to add following methods to your project:
|
35
35
|
|
36
|
-
user_signed_in?
|
37
36
|
current_user
|
38
37
|
after_sign_in_path_for(current_user)
|
39
38
|
authenticate_user!
|
@@ -89,7 +89,7 @@ module Petergate
|
|
89
89
|
allowances = [rules[:all]]
|
90
90
|
current_user.roles.each do |role|
|
91
91
|
allowances << rules[role]
|
92
|
-
end if
|
92
|
+
end if user_logged_in?
|
93
93
|
allowances.flatten.compact.include?(action_name.to_sym)
|
94
94
|
end
|
95
95
|
|
@@ -97,6 +97,10 @@ module Petergate
|
|
97
97
|
current_user && current_user.has_roles?(*roles)
|
98
98
|
end
|
99
99
|
|
100
|
+
def user_logged_in?
|
101
|
+
!!current_user
|
102
|
+
end
|
103
|
+
|
100
104
|
def custom_message
|
101
105
|
defined?(self.class.controller_message) ? self.class.controller_message : 'Permission Denied'
|
102
106
|
end
|
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.
|
4
|
+
version: 1.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Isaac Sloan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|