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 +4 -4
- data/lib/devise_roles.rb +2 -2
- data/lib/devise_roles/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c4a26a17a5bfe54bfe0db5a9cd2e0d373bd35e5
|
4
|
+
data.tar.gz: 8dc3d925589c258720b3536db2a9af33ab79d2e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
data/lib/devise_roles/version.rb
CHANGED