the_role 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +9 -6
- data/lib/the_role/version.rb +1 -1
- data/lib/the_role.rb +1 -1
- metadata +5 -5
data/README.md
CHANGED
@@ -57,12 +57,15 @@ end
|
|
57
57
|
|
58
58
|
``` ruby
|
59
59
|
class ArticlesController < ApplicationController
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
before_filter :
|
64
|
-
before_filter :
|
65
|
-
|
60
|
+
# Auth system
|
61
|
+
before_filter :login_required, :except=>[:index, :show, :tag]
|
62
|
+
# Role system
|
63
|
+
before_filter :the_role_require, :except => [:index, :show, :tag]
|
64
|
+
before_filter :the_role_object, :only => [:edit, :update, :rebuild, :destroy]
|
65
|
+
before_filter :the_owner_require, :only => [:edit, :update, :rebuild, :destroy]
|
66
|
+
|
67
|
+
# actions
|
68
|
+
|
66
69
|
end
|
67
70
|
```
|
68
71
|
|
data/lib/the_role/version.rb
CHANGED
data/lib/the_role.rb
CHANGED
@@ -104,7 +104,7 @@ module TheRole
|
|
104
104
|
# define class variable for *the_owner_require* filter with Controller class name
|
105
105
|
# @the_role_object = @article
|
106
106
|
def the_role_object
|
107
|
-
variable_name = self.to_s.tableize.split('_').first.singularize.split('/').last
|
107
|
+
variable_name = self.class.to_s.tableize.split('_').first.singularize.split('/').last
|
108
108
|
@the_role_object = self.instance_variable_get("@#{variable_name}")
|
109
109
|
end
|
110
110
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the_role
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-11-12 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: haml
|
16
|
-
requirement: &
|
16
|
+
requirement: &83261880 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *83261880
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: sass
|
27
|
-
requirement: &
|
27
|
+
requirement: &83261670 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *83261670
|
36
36
|
description: TheRole - simple, but powerful role system for ROR applications
|
37
37
|
email:
|
38
38
|
- zykin-ilya@ya.ru
|