darkhelmet-role_on 0.2.6 → 0.2.7

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.
Files changed (5) hide show
  1. data/README.md +1 -1
  2. data/VERSION +1 -1
  3. data/lib/role_on.rb +2 -0
  4. data/role_on.gemspec +2 -3
  5. metadata +2 -2
data/README.md CHANGED
@@ -48,7 +48,7 @@ Do your own thing for managing roles.
48
48
  Start locking down your controllers
49
49
 
50
50
  role_on(:admin, :on => [:new,:create,:destroy])
51
- role_on(:regular, :on => [:edit,:update])
51
+ role_on(:regular, :only => [:edit,:update])
52
52
 
53
53
  Add your views
54
54
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.7
data/lib/role_on.rb CHANGED
@@ -7,6 +7,8 @@ module RoleOn
7
7
  user_roles = c.__send__(:current_user).roles.map(&:name).map(&:intern)
8
8
  restricted_actions = if options.include?(:on)
9
9
  [options[:on]].flatten
10
+ elsif options.include?(:only)
11
+ [options[:only]].flatten
10
12
  elsif options.include?(:except)
11
13
  c.class.action_methods.to_a.map(&:intern) - [options[:except]].flatten
12
14
  else
data/role_on.gemspec CHANGED
@@ -1,15 +1,14 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
2
  # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
3
  # -*- encoding: utf-8 -*-
5
4
 
6
5
  Gem::Specification.new do |s|
7
6
  s.name = %q{role_on}
8
- s.version = "0.2.6"
7
+ s.version = "0.2.7"
9
8
 
10
9
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
10
  s.authors = ["Daniel Huckstep"]
12
- s.date = %q{2009-08-21}
11
+ s.date = %q{2009-08-24}
13
12
  s.email = %q{darkhelmet@darkhelmetlive.com}
14
13
  s.extra_rdoc_files = [
15
14
  "LICENSE",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darkhelmet-role_on
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Huckstep
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-21 00:00:00 -07:00
12
+ date: 2009-08-24 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15