esp-auth 1.4.0 → 1.4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/esp_auth/engine.rb +2 -3
- data/lib/esp_auth/spec_helper.rb +5 -1
- data/lib/esp_auth/version.rb +1 -1
- metadata +3 -3
data/lib/esp_auth/engine.rb
CHANGED
@@ -41,12 +41,10 @@ module EspAuth
|
|
41
41
|
undef_method "#{role}_of?", "#{role}?"
|
42
42
|
|
43
43
|
define_method "#{role}_of?" do |context|
|
44
|
-
|
45
|
-
p permissions.for_role(role).for_context_and_ancestors(context).exists?
|
44
|
+
permissions.for_role(role).for_context_and_ancestors(context).exists?
|
46
45
|
end
|
47
46
|
|
48
47
|
define_method "#{role}?" do
|
49
|
-
puts ">>> in #{role}? <<<"
|
50
48
|
permissions.for_role(role).exists?
|
51
49
|
end
|
52
50
|
end
|
@@ -152,6 +150,7 @@ module EspAuth
|
|
152
150
|
end
|
153
151
|
|
154
152
|
def self.esp_auth_subcontext
|
153
|
+
attr_accessible :title, :context
|
155
154
|
belongs_to :context
|
156
155
|
has_many :permissions, :as => :context
|
157
156
|
|
data/lib/esp_auth/spec_helper.rb
CHANGED
@@ -15,7 +15,11 @@ module EspAuth
|
|
15
15
|
@roles ||= {}
|
16
16
|
@roles["#{prefix}_#{role}"] ||= {}
|
17
17
|
@roles["#{prefix}_#{role}"][context] ||= create_user.tap do |user|
|
18
|
-
user.permissions.
|
18
|
+
user.permissions.new do |permission|
|
19
|
+
permission.context = context
|
20
|
+
permission.role = role
|
21
|
+
permission.save!
|
22
|
+
end
|
19
23
|
end
|
20
24
|
end
|
21
25
|
|
data/lib/esp_auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esp-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.0
|
4
|
+
version: 1.4.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -627,7 +627,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
627
627
|
version: '0'
|
628
628
|
segments:
|
629
629
|
- 0
|
630
|
-
hash:
|
630
|
+
hash: 323565399926700094
|
631
631
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
632
632
|
none: false
|
633
633
|
requirements:
|
@@ -636,7 +636,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
636
636
|
version: '0'
|
637
637
|
segments:
|
638
638
|
- 0
|
639
|
-
hash:
|
639
|
+
hash: 323565399926700094
|
640
640
|
requirements: []
|
641
641
|
rubyforge_project:
|
642
642
|
rubygems_version: 1.8.24
|