devise_roles 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -24
- data/devise_roles-0.2.2.gem +0 -0
- data/lib/devise_roles/version.rb +1 -1
- data/lib/devise_roles.rb +4 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d53579469d6263849aabfb1148fe6e93e2d78f37
|
4
|
+
data.tar.gz: d56a46894e63713c4c980824703250b0d2259d3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c180928480d40a806290e00c5c4c599375ebce57ea269d80f4145e96175da899200e7b1eeb89bd3e8beb893b646eb7696837e88aa975f433688e2f68a7899eb7
|
7
|
+
data.tar.gz: be84e9b44328ac01c1bd766797f8096877f9b4284f50ed30ecfc17e2f9e2cef099d50c3f1cac890aca0e48139ca9ce2cf550ca5def5de567900886e0722401ba
|
data/README.md
CHANGED
@@ -80,39 +80,27 @@ Now you can go to learn methods for this *gem*.
|
|
80
80
|
Here is a list of available methods.
|
81
81
|
|
82
82
|
#### user_is
|
83
|
-
|
84
|
-
```ruby
|
85
|
-
DeviseRoles.user_is(user_role_name, current_user)
|
86
|
-
```
|
83
|
+
Use this to check if user has the role you need.
|
87
84
|
Here is some example how to use it
|
88
85
|
```ruby
|
89
|
-
|
90
|
-
#
|
91
|
-
|
92
|
-
if DeviseRoles.user_is('admin', current_user)
|
93
|
-
# Everything is ok!
|
94
|
-
end
|
95
|
-
|
96
|
-
# Some other code ...
|
86
|
+
if DeviseRoles.user_is('admin', current_user)
|
87
|
+
# Everything is ok!
|
97
88
|
end
|
98
89
|
```
|
99
90
|
|
100
91
|
#### user_not
|
101
|
-
Also there is an opposite method
|
92
|
+
Also there is an opposite method.
|
93
|
+
Here is one more example
|
102
94
|
```ruby
|
103
|
-
|
95
|
+
if DeviseRoles.user_not('admin', current_user)
|
96
|
+
# User is NOT **admin** !!!
|
97
|
+
end
|
104
98
|
```
|
105
|
-
Here is some example how to use it
|
106
|
-
```ruby
|
107
|
-
def some_controller_method_name
|
108
|
-
# Some other code ...
|
109
|
-
|
110
|
-
if DeviseRoles.user_not('admin', current_user)
|
111
|
-
# User is NOT **admin** !!!
|
112
|
-
end
|
113
99
|
|
114
|
-
|
115
|
-
|
100
|
+
#### add_role_to_user
|
101
|
+
If you want quickly add specific role to user, like in the example
|
102
|
+
```ruby
|
103
|
+
DeviseRoles.add_role_to_user(Role.where(:name => 'banned')[0], current_user)
|
116
104
|
```
|
117
105
|
|
118
106
|
## License
|
Binary file
|
data/lib/devise_roles/version.rb
CHANGED
data/lib/devise_roles.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MarkusBansky
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- devise_roles-0.1.9.gem
|
95
95
|
- devise_roles-0.2.0.gem
|
96
96
|
- devise_roles-0.2.1.gem
|
97
|
+
- devise_roles-0.2.2.gem
|
97
98
|
- devise_roles.gemspec
|
98
99
|
- lib/devise_roles.rb
|
99
100
|
- lib/devise_roles/version.rb
|