darkhelmet-role_on 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.md +6 -0
  2. data/VERSION +1 -1
  3. data/lib/role_on.rb +1 -1
  4. data/role_on.gemspec +2 -2
  5. metadata +2 -2
data/README.md CHANGED
@@ -58,6 +58,12 @@ Can also use except
58
58
 
59
59
  role_on(:admin, :except => [:index,:show])
60
60
 
61
+ Can specify :sa to allow a 'superadmin' to gain access even if they don't have the specific role
62
+
63
+ role_on(:foo_admin, :sa => :super_admin)
64
+
65
+ In that case, users who either have the :foo_admin or :super_admin role will have access
66
+
61
67
  # License
62
68
 
63
69
  See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.2.0
data/lib/role_on.rb CHANGED
@@ -11,7 +11,7 @@ module RoleOn
11
11
  else
12
12
  c.class.action_methods.to_a.map(&:intern)
13
13
  end
14
- if restricted_actions.include?(action) && !user_roles.include?(role)
14
+ if restricted_actions.include?(action) && !user_roles.include?(role) && (options.include?(:sa) ? !user_roles.include?(options[:sa]) : false)
15
15
  c.send(:access_denied)
16
16
  false
17
17
  end
data/role_on.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{role_on}
5
- s.version = "0.1.4"
5
+ s.version = "0.2.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Daniel Huckstep"]
9
- s.date = %q{2009-07-15}
9
+ s.date = %q{2009-07-23}
10
10
  s.email = %q{darkhelmet@darkhelmetlive.com}
11
11
  s.extra_rdoc_files = [
12
12
  "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.1.4
4
+ version: 0.2.0
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-07-15 00:00:00 -07:00
12
+ date: 2009-07-23 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15