devise_roles 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/devise_roles-0.1.1.gem +0 -0
- data/devise_roles-0.1.2.gem +0 -0
- data/devise_roles-0.1.3.gem +0 -0
- data/lib/devise_roles/version.rb +1 -1
- data/lib/devise_roles.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e4d5dc808ce9ccbbe752e050002b3de64f31ca1
|
4
|
+
data.tar.gz: 895f319980456bb8d52b9828e34c17efa3228603
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da464d788b962cf42149a82faf886036fa04c796137181643a84bd37244433febd0ebadaf0828c3a4dab33bd1875ac7276a3aeeaf5e441c0e5dddc6afe3f37e0
|
7
|
+
data.tar.gz: 5f2aa3635e7bea9864591b7097327516ef32066a005dc65e9b6c23872767b62d3a5750ea011deb4b7b247c8ce4fcee4b32db2e10b16fd3b805c39d62f1ed25c7
|
data/README.md
CHANGED
@@ -22,6 +22,17 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
$ gem install devise_roles
|
24
24
|
|
25
|
+
Also you need to include it in your Application
|
26
|
+
|
27
|
+
In your **application.rb** add This
|
28
|
+
```ruby
|
29
|
+
require 'encryption/encryption'
|
30
|
+
```
|
31
|
+
You can create and initializer and add next line to it, or just write at top of your controllers
|
32
|
+
```ruby
|
33
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
34
|
+
```
|
35
|
+
|
25
36
|
## Usage
|
26
37
|
|
27
38
|
To use this gem features, you should create table **Roles** and add roles to it.
|
Binary file
|
Binary file
|
Binary file
|
data/lib/devise_roles/version.rb
CHANGED
data/lib/devise_roles.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "devise_roles/version"
|
2
2
|
|
3
3
|
module DeviseRoles
|
4
|
-
def available_for_user_role(user_role_name, user_redirect_path)
|
4
|
+
def self.available_for_user_role(user_role_name, user_redirect_path)
|
5
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
|
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.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MarkusBansky
|
@@ -70,6 +70,9 @@ files:
|
|
70
70
|
- bin/console
|
71
71
|
- bin/setup
|
72
72
|
- devise_roles-0.1.0.gem
|
73
|
+
- devise_roles-0.1.1.gem
|
74
|
+
- devise_roles-0.1.2.gem
|
75
|
+
- devise_roles-0.1.3.gem
|
73
76
|
- devise_roles.gemspec
|
74
77
|
- lib/devise_roles.rb
|
75
78
|
- lib/devise_roles/version.rb
|