petergate 0.1.17 → 0.1.18

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: 957ee14ef64ca5211f9d42069de46a3f4429cc2d
4
- data.tar.gz: 56bfd569f9a262fa639eebe303c3fd5644f7f195
3
+ metadata.gz: 91c85b6f22876391d247cc977089665b94230574
4
+ data.tar.gz: 2092fda54c52443bfb2df6cee9da073026eda443
5
5
  SHA512:
6
- metadata.gz: 8d4a0d01c213460ea78e9fec901b6baeea947df053672fd251f7c5ea9ce1e4ddb471b846bbef10f42451ea759dcabc89ad56d4fe17abc94e0dadd41fbee33a1d
7
- data.tar.gz: adf7ce67254f24cc83741eb9080a8c483f51d6fd4b2a4c13a199233059a4da01b39d673a9df8b94f17cf55cddf3bf200fb37e8081ca87c276cbf1ba83cb6e95f
6
+ metadata.gz: 81efb57941dd3632e7cfb44106efddf1ad0c7c1f9231a46fe8232ee98cdae77e1da5716898e7272de2abe82ad60a7f8955c3a64dde430cd46aa1a44f857c2a57
7
+ data.tar.gz: e3f2f8c13f9302dfd4f091ab0fbbb3decb128a66e24f75b21725fc09f726484b12437c4580c22164db33259a45abd3adc20c47449cdf9f0a22305b77cd5b0037
data/lib/petergate.rb CHANGED
@@ -35,7 +35,12 @@ module PeterGate
35
35
  message= defined?(check_access) ? check_access : true
36
36
  if message.is_a?(String) || message == false
37
37
  if user_signed_in?
38
- redirect_to (request.referrer || after_sign_in_path_for(current_user)), :notice => message || "Permission Denied"
38
+ respond_to do |format|
39
+ format.any(:js, :json, :xml) { render nothing: true, status: :forbidden }
40
+ format.html do
41
+ redirect_to (request.referrer || after_sign_in_path_for(current_user)), :notice => message || "Permission Denied"
42
+ end
43
+ end
39
44
  else
40
45
  authenticate_user!
41
46
  end
@@ -1,3 +1,3 @@
1
1
  module Petergate
2
- VERSION = "0.1.17"
2
+ VERSION = "0.1.18"
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: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Sloan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-12 00:00:00.000000000 Z
11
+ date: 2014-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler