lockdown 0.5.18 → 0.5.19

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,5 @@
1
+ == 0.5.19 2008-08-01
2
+ * Modified the lockdown system to account for permissions added/removed from user groups in init.rb. This will NOT manage user groups defined via the admin screens.
1
3
  == 0.5.18 2008-07-23
2
4
  * Changed the generator options to simplify things. The default now is to generate all templates.
3
5
  == 0.5.17 2008-07-21
data/PostInstall.txt CHANGED
@@ -1,3 +1,3 @@
1
1
 
2
- For more information on lockdown, see http://lockdown.rubyforge.org
2
+ For more information on lockdown, see http://stonean.com
3
3
 
@@ -359,6 +359,32 @@ module Lockdown
359
359
  values(#{p.id}, #{ug.id})
360
360
  SQL
361
361
  end
362
+ else
363
+ # Remove permissions from user group not found in init.rb
364
+ ug.permissions.each do |perm|
365
+ perm_sym = lockdown_symbol(perm)
366
+ perm_string = lockdown_string(perm)
367
+ unless @user_groups[key].include?(perm_sym)
368
+ puts ">> Lockdown: Permission: #{perm_string} no longer associated to User Group: #{ug.name}, deleting."
369
+ ug.permissions.delete(perm)
370
+ end
371
+ end
372
+
373
+ # Add in permissions from init.rb not found in database
374
+ @user_groups[key].each do |perm|
375
+ perm_string = lockdown_string(perm)
376
+ found = false
377
+ # see if permission exists
378
+ ug.permissions.each do |p|
379
+ found = true if lockdown_string(p) == perm_string
380
+ end
381
+ # if not found, add it
382
+ unless found
383
+ puts ">> Lockdown: Permission: #{perm_string} not found for User Group: #{ug.name}, adding it."
384
+ p = Permission.find(:first, :conditions => ["name = ?", perm_string])
385
+ ug.permissions << p
386
+ end
387
+ end
362
388
  end
363
389
  end
364
390
  rescue Exception => e
@@ -2,7 +2,7 @@ module Lockdown #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- TINY = 18
5
+ TINY = 19
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>Lockdown</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/lockdown"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/lockdown" class="numbers">0.5.18</a>
36
+ <a href="http://rubyforge.org/projects/lockdown" class="numbers">0.5.19</a>
37
37
  </div>
38
38
  <h2>What</h2>
39
39
  <p>Lockdown is a authentication/authorization system for RubyOnRails (ver 2.x). While Merb functionality is in place, it is not complete. There will be a release solely focused on getting the Merb functionality up to par with Rails.</p>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lockdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.18
4
+ version: 0.5.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Stone
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-07-23 00:00:00 -04:00
12
+ date: 2008-08-01 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -128,7 +128,7 @@ has_rdoc: true
128
128
  homepage: http://lockdown.rubyforge.org
129
129
  post_install_message: |+
130
130
 
131
- For more information on lockdown, see http://lockdown.rubyforge.org
131
+ For more information on lockdown, see http://stonean.com
132
132
 
133
133
  rdoc_options:
134
134
  - --main