easy_roles 0.1.3 → 0.2.0
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.
- data/README.rdoc +1 -1
- data/Rakefile +1 -1
- data/easy_roles.gemspec +2 -2
- data/lib/easy_roles.rb +10 -0
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -97,7 +97,7 @@ Then in your AdminsController or any controller that you only want admins to vie
|
|
97
97
|
before_filter :admin_required, :only => :create, :update
|
98
98
|
end
|
99
99
|
|
100
|
-
check out http://blog.platform45.com/2009/10/
|
100
|
+
check out http://blog.platform45.com/2009/10/05/howto-basic-roles-for-users for implementation, and http://blog.platform45.com/2009/10/07/easy-roles-gem-released for usage.
|
101
101
|
|
102
102
|
|
103
103
|
== License
|
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.
|
5
|
+
Echoe.new('easy_roles', '0.2.0') 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,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{easy_roles}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.2.0"
|
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"]
|
9
|
-
s.date = %q{2009-10-
|
9
|
+
s.date = %q{2009-10-21}
|
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"]
|
data/lib/easy_roles.rb
CHANGED
@@ -17,11 +17,21 @@ module EasyRoles
|
|
17
17
|
def add_role(role)
|
18
18
|
self.#{name} << role
|
19
19
|
end
|
20
|
+
|
21
|
+
def add_role!(role)
|
22
|
+
add_role(role)
|
23
|
+
self.save!
|
24
|
+
end
|
20
25
|
|
21
26
|
def remove_role(role)
|
22
27
|
self.#{name}.delete(role)
|
23
28
|
end
|
24
29
|
|
30
|
+
def remove_role!(role)
|
31
|
+
remove_role(role)
|
32
|
+
self.save!
|
33
|
+
end
|
34
|
+
|
25
35
|
def clear_roles
|
26
36
|
self.#{name} = []
|
27
37
|
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
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platform45
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-21 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|