lockdown 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.6.3 2008-12-02
2
+ * Fixed: Database sync was failing. Cause of refactor. Apologies
3
+
1
4
  == 0.6.2 2008-12-01
2
5
  * Fixed: Made call to action_methods instead of calculating controller actions
3
6
 
@@ -17,6 +17,7 @@ module Lockdown
17
17
  maintain_user_groups
18
18
  rescue Exception => e
19
19
  puts ">> Lockdown sync failed: #{e}"
20
+ puts ">> #{e.backtrace.join("\n")}"
20
21
  end
21
22
 
22
23
  private
@@ -51,7 +52,7 @@ module Lockdown
51
52
  @user_groups.each do |key|
52
53
  str = Lockdown.get_string(key)
53
54
  unless ug = UserGroup.find(:first, :conditions => ["name = ?", str])
54
- create_user_group(str)
55
+ create_user_group(str, key)
55
56
  else
56
57
  # Remove permissions from user group not found in init.rb
57
58
  remove_invalid_permissions(ug, key)
@@ -62,7 +63,7 @@ module Lockdown
62
63
  end
63
64
  end
64
65
 
65
- def create_user_group(name_str)
66
+ def create_user_group(name_str, key)
66
67
  puts ">> Lockdown: UserGroup not in the db: #{name_str}, creating."
67
68
  ug = UserGroup.create(:name => name_str)
68
69
  #Inefficient, definitely, but shouldn't have any issues across orms.
@@ -79,7 +80,7 @@ module Lockdown
79
80
  ug.permissions.each do |perm|
80
81
  perm_sym = Lockdown.get_symbol(perm)
81
82
  perm_string = Lockdown.get_string(perm)
82
- unless @user_groups[key].include?(perm_sym)
83
+ unless Lockdown::System.permissions_for_user_group(key).include?(perm_sym)
83
84
  puts ">> Lockdown: Permission: #{perm_string} no longer associated to User Group: #{ug.name}, deleting."
84
85
  ug.permissions.delete(perm)
85
86
  end
@@ -87,7 +88,7 @@ module Lockdown
87
88
  end
88
89
 
89
90
  def add_valid_permissions(ug, key)
90
- @user_groups[key].each do |perm|
91
+ Lockdown::System.permissions_for_user_group(key).each do |perm|
91
92
  perm_string = Lockdown.get_string(perm)
92
93
  found = false
93
94
  # see if permission exists
@@ -1,7 +1,7 @@
1
1
  module Lockdown
2
2
  module Rights
3
- attr_reader :permissions #:nodoc:
4
- attr_reader :user_groups #:nodoc:
3
+ attr_accessor :permissions #:nodoc:
4
+ attr_accessor :user_groups #:nodoc:
5
5
 
6
6
  # :public_access allows access to all
7
7
  attr_reader :public_access #:nodoc:
@@ -2,7 +2,7 @@ module Lockdown #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 6
5
- TINY = 2
5
+ TINY = 3
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
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.6.2
4
+ version: 0.6.3
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-12-01 00:00:00 -05:00
12
+ date: 2008-12-02 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency