roles_generic 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +8 -7
- data/VERSION +1 -1
- data/roles_generic.gemspec +2 -2
- metadata +3 -3
data/README.markdown
CHANGED
@@ -12,14 +12,10 @@ I have developed the following *roles* gems for popular ORMs that all support th
|
|
12
12
|
|
13
13
|
Feel free to roll your own ORM extension for your favorite ORM!
|
14
14
|
|
15
|
-
## Status update (4 sept, 2010)
|
16
15
|
|
17
|
-
|
16
|
+
## Status update (12 sept, 2010)
|
18
17
|
|
19
|
-
|
20
|
-
However my gem to test generators (called [generator-spec](http://github.com/kristianmandrup/generator-spec), is currently not functioning as it has dependencies to other gems that have undergone major
|
21
|
-
|
22
|
-
refactorings lately. Let me know if the generator works or if not, see if you can make it work using *rails3_artifactor* and let me know the fix ;)
|
18
|
+
Roles generic has now been refactored in order to tidy up the code base and make it even more generic, flexible and easy to extend. It should now work! Please let me know if you have any issues ;)
|
23
19
|
|
24
20
|
## Install
|
25
21
|
|
@@ -29,17 +25,20 @@ refactorings lately. Let me know if the generator works or if not, see if you ca
|
|
29
25
|
|
30
26
|
The library comes with the following role models built-in:
|
31
27
|
|
28
|
+
Inline roles (in User model):
|
32
29
|
* admin_flag (Boolean flag - 'admin' or not)
|
33
30
|
* role_string (String)
|
34
31
|
* roles_string (Comma separated String - note: no role name must have a comma in its name!)
|
35
32
|
* role_strings (Set of Strings)
|
36
33
|
* roles_mask (Integer mask)
|
34
|
+
|
35
|
+
Using separate Role model:
|
37
36
|
* one_role (relation to a Role model instance)
|
38
37
|
* many_roles(Set of Role relationships)
|
39
38
|
|
40
39
|
Note: The following examples use RSpec to demonstrate usage scenarios.
|
41
40
|
|
42
|
-
Examples of configuring for the other strategies can be found
|
41
|
+
Examples of configuring for the other strategies can be found on the wiki pages.
|
43
42
|
|
44
43
|
## Example : admin_flag
|
45
44
|
|
@@ -85,6 +84,8 @@ Data Mapper with persistent attributes :name and :admin_flag
|
|
85
84
|
end
|
86
85
|
</pre>
|
87
86
|
|
87
|
+
_Note:_ I recommend using s specific ORM roles gem such as *roles_data_mapper* instead. But this approach might be a good starting point for developing a *roles* gem for an ORM that is not supported ;)
|
88
|
+
|
88
89
|
## Role API
|
89
90
|
|
90
91
|
### Instance methods
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
data/roles_generic.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{roles_generic}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kristian Mandrup"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-12}
|
13
13
|
s.description = %q{Generic role strategies sharing the same API. Easy to insert in any model}
|
14
14
|
s.email = %q{kmandrup@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 4
|
9
|
+
version: 0.2.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kristian Mandrup
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-12 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|