easy_roles 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
data/Manifest
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
Manifest
|
2
2
|
README.rdoc
|
3
3
|
Rakefile
|
4
|
+
generators/easy_bitmask_roles/USAGE
|
5
|
+
generators/easy_bitmask_roles/easy_bitmask_roles_generator.rb
|
6
|
+
generators/easy_bitmask_roles/templates/migration.rb
|
4
7
|
generators/easy_roles/USAGE
|
5
8
|
generators/easy_roles/easy_roles_generator.rb
|
6
9
|
generators/easy_roles/templates/migration.rb
|
data/README.rdoc
CHANGED
@@ -4,6 +4,12 @@ Simple rails gem for basic role authorization with ruby on rails.
|
|
4
4
|
|
5
5
|
== Changelog
|
6
6
|
|
7
|
+
=== 08 December 2009 - Version 0.4.0
|
8
|
+
Added the ability to use bitmasks instead of serializing the roles in a table
|
9
|
+
|
10
|
+
=== 17 November 2009 - Version 0.3.0
|
11
|
+
Added a generator to generate the database columns "script/generate easy_roles Table Column_Name"
|
12
|
+
|
7
13
|
=== 21 October 2009 - Version 0.2.0
|
8
14
|
Added bang methods for 'add_role' and 'remove_role' which can be accessed through 'add_role!' and 'remove_role!' respectively.
|
9
15
|
|
@@ -19,6 +25,8 @@ or it can be installed as a rails plugin.
|
|
19
25
|
|
20
26
|
== Basic Setup
|
21
27
|
|
28
|
+
=== Serialize Method
|
29
|
+
|
22
30
|
Add the following to your enviroment.rb in the rails initializer block
|
23
31
|
|
24
32
|
config.gem 'easy_roles', :source => 'http://gemcutter.org'
|
@@ -37,6 +45,12 @@ Then you need to add "easy_roles :column_name" to your model.
|
|
37
45
|
easy_roles :roles
|
38
46
|
end
|
39
47
|
|
48
|
+
=== Bitmask Method
|
49
|
+
|
50
|
+
Add the following to your enviroment.rb in the rails initializer block
|
51
|
+
|
52
|
+
config.gem 'easy_roles', :source => 'http://gemcutter.org'
|
53
|
+
|
40
54
|
And thats it.
|
41
55
|
|
42
56
|
== Usage
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('easy_roles', '0.4.
|
5
|
+
Echoe.new('easy_roles', '0.4.1') do |p|
|
6
6
|
p.description = "Easy role authorization in rails"
|
7
7
|
p.url = "http://github.com/platform45/easy_roles"
|
8
8
|
p.author = "Platform45"
|
data/easy_roles.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{easy_roles}
|
5
|
-
s.version = "0.4.
|
5
|
+
s.version = "0.4.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Platform45"]
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.description = %q{Easy role authorization in rails}
|
11
11
|
s.email = %q{ryan@platform45.com}
|
12
12
|
s.extra_rdoc_files = ["README.rdoc", "lib/easy_roles.rb"]
|
13
|
-
s.files = ["Manifest", "README.rdoc", "Rakefile", "generators/easy_roles/USAGE", "generators/easy_roles/easy_roles_generator.rb", "generators/easy_roles/templates/migration.rb", "init.rb", "lib/easy_roles.rb", "easy_roles.gemspec"]
|
13
|
+
s.files = ["Manifest", "README.rdoc", "Rakefile", "generators/easy_bitmask_roles/USAGE", "generators/easy_bitmask_roles/easy_bitmask_roles_generator.rb", "generators/easy_bitmask_roles/templates/migration.rb", "generators/easy_roles/USAGE", "generators/easy_roles/easy_roles_generator.rb", "generators/easy_roles/templates/migration.rb", "init.rb", "lib/easy_roles.rb", "easy_roles.gemspec"]
|
14
14
|
s.homepage = %q{http://github.com/platform45/easy_roles}
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Easy_roles", "--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
@@ -0,0 +1,11 @@
|
|
1
|
+
NAME
|
2
|
+
easy_bitmask_roles - generates migration for your bitmask roles authorization column
|
3
|
+
|
4
|
+
USAGE
|
5
|
+
./script/generate easy_bitmask_roles Model Column_Name
|
6
|
+
|
7
|
+
EXAMPLE
|
8
|
+
./script/generate easy_bitmask_roles user roles_mask
|
9
|
+
|
10
|
+
MORE INFO
|
11
|
+
http://github.com/platform45/easy_roles
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class AddBitmaskRolesTo<%= class_name.pluralize %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :<%= table_name %>, :<%= args.first %>, :integer, :default => 0
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.down
|
7
|
+
remove_column :<%= table_name.to_sym %>, :<%= args.first.to_sym %>
|
8
|
+
end
|
9
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_roles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platform45
|
@@ -26,6 +26,9 @@ files:
|
|
26
26
|
- Manifest
|
27
27
|
- README.rdoc
|
28
28
|
- Rakefile
|
29
|
+
- generators/easy_bitmask_roles/USAGE
|
30
|
+
- generators/easy_bitmask_roles/easy_bitmask_roles_generator.rb
|
31
|
+
- generators/easy_bitmask_roles/templates/migration.rb
|
29
32
|
- generators/easy_roles/USAGE
|
30
33
|
- generators/easy_roles/easy_roles_generator.rb
|
31
34
|
- generators/easy_roles/templates/migration.rb
|