This repository was archived by the owner on Nov 15, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -157,15 +157,20 @@ def remove_attributes_protected_from_mass_assignment(targets)
157
157
needless_attributes [ to_real_attribute_name ( name ) ] = true
158
158
end
159
159
160
+ _dn_attribute = nil
161
+ begin
162
+ _dn_attribute = dn_attribute_with_fallback
163
+ rescue DistinguishedNameInvalid
164
+ end
160
165
targets . collect do |key , value |
166
+ key = _dn_attribute if [ "id" , "dn" ] . include? ( key . to_s )
161
167
[ to_real_attribute_name ( key ) || key , value ]
162
168
end . reject do |key , value |
163
169
needless_attributes [ key ]
164
170
end
165
171
end
166
172
167
173
def attributes_protected_by_default
168
- _dn_attribute = nil
169
174
begin
170
175
_dn_attribute = dn_attribute_with_fallback
171
176
rescue DistinguishedNameInvalid
Original file line number Diff line number Diff line change @@ -6,6 +6,15 @@ class TestBase < Test::Unit::TestCase
6
6
include AlTestUtils
7
7
8
8
priority :must
9
+ def test_not_rename_by_mass_update
10
+ make_temporary_user ( :simple => true ) do |user , |
11
+ original_id = user . id
12
+ assert_true ( user . update_attributes ( :id => "user2" ) )
13
+ assert_equal ( original_id , user . id )
14
+ end
15
+ end
16
+
17
+ priority :normal
9
18
def test_attributes
10
19
make_temporary_group do |group |
11
20
assert_equal ( {
@@ -17,7 +26,6 @@ def test_attributes
17
26
end
18
27
end
19
28
20
- priority :normal
21
29
def test_rename_with_superior
22
30
make_ou ( "sub,ou=users" )
23
31
make_temporary_user ( :simple => true ) do |user , |
You can’t perform that action at this time.
0 commit comments