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 +3 -0
- data/lib/lockdown/database.rb +5 -4
- data/lib/lockdown/rights.rb +2 -2
- data/lib/lockdown/version.rb +1 -1
- metadata +2 -2
data/History.txt
CHANGED
data/lib/lockdown/database.rb
CHANGED
@@ -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
|
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
|
-
|
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
|
data/lib/lockdown/rights.rb
CHANGED
data/lib/lockdown/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2008-12-02 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|