Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0929fbca
Commit
0929fbca
authored
Aug 15, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a smarter way to transation to multi LDAP links push
parent
0d782652
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
app/models/group.rb
app/models/group.rb
+0
-8
app/services/ldap_group_reset_service.rb
app/services/ldap_group_reset_service.rb
+3
-0
db/migrate/20140813133925_rename_ldap_group_to_ldap_group_link.rb
...te/20140813133925_rename_ldap_group_to_ldap_group_link.rb
+7
-2
No files found.
app/models/group.rb
View file @
0929fbca
...
@@ -89,12 +89,4 @@ class Group < Namespace
...
@@ -89,12 +89,4 @@ class Group < Namespace
def
ldap_access
def
ldap_access
ldap_group_links
.
first
.
try
(
:group_access
)
ldap_group_links
.
first
.
try
(
:group_access
)
end
end
def
old_ldap_cn
read_attribute
(
:ldap_cn
)
end
def
old_ldap_access
read_attribute
(
:ldap_access
)
end
end
end
app/services/ldap_group_reset_service.rb
View file @
0929fbca
class
LdapGroupResetService
class
LdapGroupResetService
def
execute
(
group
,
current_user
)
def
execute
(
group
,
current_user
)
# Only for ldap connected users
# reset last_credential_check_at
# set Gitlab::Access::Guest
group
.
members
.
includes
(
:user
).
each
do
|
member
|
group
.
members
.
includes
(
:user
).
each
do
|
member
|
user
=
member
.
user
user
=
member
.
user
...
...
db/migrate/20140813133925_rename_ldap_group_to_ldap_group_link.rb
View file @
0929fbca
...
@@ -4,9 +4,14 @@ class RenameLdapGroupToLdapGroupLink < ActiveRecord::Migration
...
@@ -4,9 +4,14 @@ class RenameLdapGroupToLdapGroupLink < ActiveRecord::Migration
# NOTE: we use the old_ methods because the new methods are overloaded
# NOTE: we use the old_ methods because the new methods are overloaded
# for backwards compatibility
# for backwards compatibility
Group
.
where
.
not
(
ldap_cn:
nil
).
each
do
|
group
|
Group
.
where
.
not
(
ldap_cn:
nil
).
each
do
|
group
|
group
.
ldap_group_links
.
where
(
cn:
group
.
old_ldap_cn
).
first_or_create
do
|
ldap_group_link
|
# Make sure we use the database column, not the model methods
ldap_group_link
.
group_access
=
group
.
old_ldap_access
ldap_cn
=
group
.
read_attribute
(
:ldap_cn
)
ldap_access
=
group
.
read_attribute
(
:ldap_access
)
group
.
ldap_group_links
.
where
(
cn:
ldap_cn
).
first_or_create
do
|
ldap_group_link
|
ldap_group_link
.
group_access
=
ldap_access
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment