devise_roles 0.1.5 → 0.1.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: db0b201084508aebd42a97bc67f82543737582b9
4
- data.tar.gz: b3fadeafe9c4f9d29454090a30fc7d6f02201344
3
+ metadata.gz: 1c4a26a17a5bfe54bfe0db5a9cd2e0d373bd35e5
4
+ data.tar.gz: 8dc3d925589c258720b3536db2a9af33ab79d2e3
5
5
  SHA512:
6
- metadata.gz: ec53d7a365cb5bc6828337aaf0da68caf5b329aca3c73f29c94f171066bd0239c359594ba328718706523ecb01b31ba4b83d34f9ca414f4ece55d9c082bc880c
7
- data.tar.gz: 787cb4e4694c4bce4c3ed6009d6c0c2eff6b0bb642be70421484bfa109302b8f38dedb87e37d9ed3affa06efba2429194b2b2df64cfa60d83fbf9dc3d35f00c4
6
+ metadata.gz: d23a4279e252c8c08a6add7c49c214fbea02ecf6b549d0b92632174ef2c2aae73436a923e20d5562232e21a6397b5e3b8ad786be09f3136474b3f04baacbb3ff
7
+ data.tar.gz: 15b77bb2be4f712291fe73e8357ea74d20eb0ef12683bf314b07af8f3d0f336b6797fcbf8ee94969802f7ae132855a9831ad113a8e2599a054363a5edd73b9a0
data/lib/devise_roles.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  require "devise_roles/version"
2
2
 
3
3
  module DeviseRoles
4
- def self.available_for_user_role(user_role_name, user_redirect_path)
5
- if @current_user.role.name != user_role_name
4
+ def self.available_for_user_role(user_role_name, current_user, user_redirect_path)
5
+ if current_user.role.name != user_role_name
6
6
  redirect_to admin_path, alert: "You should be #{user_role_name} to view that page!"
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module DeviseRoles
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_roles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - MarkusBansky