pebblebed 0.0.54 → 0.0.55

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.
@@ -85,12 +85,16 @@ module Sinatra
85
85
  halt 409, "missing parameters: #{missing.join(', ')}" unless missing.empty?
86
86
  end
87
87
 
88
- def require_access_to_path(path)
89
- require_identity
90
- return if current_identity.god and path.split(".")[0] == current_identity.realm
88
+ def has_access_to_path?(path)
89
+ return false unless current_identity
90
+ return true if current_identity.god and path.split(".")[0] == current_identity.realm
91
91
  res = pebbles.checkpoint.get("/identities/#{current_identity.id}/access_to/#{path}")
92
- return if res['access'] and res['access']['granted'] == true
93
- halt 403, "Access denied."
92
+ res['access'] and res['access']['granted'] == true
93
+ end
94
+
95
+ def require_access_to_path(path)
96
+ require_identity
97
+ halt 403, "Access denied." unless has_access_to_path?(path)
94
98
  end
95
99
 
96
100
  def require_action_allowed(action, uid, options={})
@@ -1,3 +1,3 @@
1
1
  module Pebblebed
2
- VERSION = "0.0.54"
2
+ VERSION = "0.0.55"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pebblebed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.54
4
+ version: 0.0.55
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-11 00:00:00.000000000 Z
13
+ date: 2013-05-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -329,12 +329,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
329
329
  - - ! '>='
330
330
  - !ruby/object:Gem::Version
331
331
  version: '0'
332
+ segments:
333
+ - 0
334
+ hash: -2508269950246086349
332
335
  required_rubygems_version: !ruby/object:Gem::Requirement
333
336
  none: false
334
337
  requirements:
335
338
  - - ! '>='
336
339
  - !ruby/object:Gem::Version
337
340
  version: '0'
341
+ segments:
342
+ - 0
343
+ hash: -2508269950246086349
338
344
  requirements: []
339
345
  rubyforge_project: pebblebed
340
346
  rubygems_version: 1.8.25