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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5373cda250caa491d55a0a8b94bd612c019348ee
4
- data.tar.gz: 333ebaf9149d8353fcf8b681bd6d86dab291e9fd
3
+ metadata.gz: fe88ac6321fea2180fa92791c94b3cca920e6d52
4
+ data.tar.gz: 751cbbe03fa230735fdd3ded6468b078ea8d1e0c
5
5
  SHA512:
6
- metadata.gz: 509ea4afc712e1206ebcc8adede1112a50b76ff1d9500f0080b223cb9d137b6ee003c00c4c3029d33d74f42b396ff3a68492f137570f134be438e7e5f5c99e5c
7
- data.tar.gz: 87b6aa060e90d294534377f519c1d53cac9be2df762d7cf283cb37b692ac6d6dcc949a740df116ea9c4eae3be0c97d6e6d3f2167f96ebaf7bdf1e8131496f656
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 logged_in?(:user)
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
@@ -1,3 +1,3 @@
1
1
  module Petergate
2
- VERSION = "1.8.1"
2
+ VERSION = "1.9.1"
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.8.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: 2017-12-09 00:00:00.000000000 Z
11
+ date: 2018-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler