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
915315a4
Commit
915315a4
authored
Aug 09, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ldap_access field added to group. set ldap group membership based on ldap_access value
parent
721758e8
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
3 deletions
+28
-3
app/models/group.rb
app/models/group.rb
+6
-1
app/views/admin/groups/edit.html.haml
app/views/admin/groups/edit.html.haml
+8
-0
app/views/groups/edit.html.haml
app/views/groups/edit.html.haml
+6
-0
db/migrate/20130809090140_add_ldap_access_to_group.rb
db/migrate/20130809090140_add_ldap_access_to_group.rb
+5
-0
db/schema.rb
db/schema.rb
+2
-1
lib/gitlab/ldap/access.rb
lib/gitlab/ldap/access.rb
+1
-1
No files found.
app/models/group.rb
View file @
915315a4
...
@@ -19,7 +19,12 @@ class Group < Namespace
...
@@ -19,7 +19,12 @@ class Group < Namespace
has_many
:project_group_links
,
dependent: :destroy
has_many
:project_group_links
,
dependent: :destroy
has_many
:shared_projects
,
through: :project_group_links
,
source:
'project'
has_many
:shared_projects
,
through: :project_group_links
,
source:
'project'
attr_accessible
:ldap_cn
attr_accessible
:ldap_cn
,
:ldap_access
validates
:ldap_access
,
inclusion:
{
in:
UsersGroup
.
group_access_roles
.
values
},
presence:
true
,
if:
->
(
group
)
{
group
.
ldap_cn
.
present?
}
after_create
:add_owner
after_create
:add_owner
...
...
app/views/admin/groups/edit.html.haml
View file @
915315a4
...
@@ -26,12 +26,20 @@
...
@@ -26,12 +26,20 @@
%li
It will change web url for access group and group projects.
%li
It will change web url for access group and group projects.
%li
It will change the git path to repositories under this group.
%li
It will change the git path to repositories under this group.
%hr
.clearfix
.clearfix
=
f
.
label
:ldap_cn
do
=
f
.
label
:ldap_cn
do
LDAP Group cn
LDAP Group cn
.input
.input
=
f
.
text_field
:ldap_cn
,
class:
"xxlarge left"
=
f
.
text_field
:ldap_cn
,
class:
"xxlarge left"
.clearfix
=
f
.
label
:ldap_access
do
LDAP Access
.input
=
f
.
select
:ldap_access
,
options_for_select
(
UsersGroup
.
group_access_roles
,
@group
.
ldap_access
)
.form-actions
.form-actions
=
f
.
submit
'Save changes'
,
class:
"btn btn-primary"
=
f
.
submit
'Save changes'
,
class:
"btn btn-primary"
=
link_to
'Cancel'
,
admin_groups_path
,
class:
"btn btn-cancel"
=
link_to
'Cancel'
,
admin_groups_path
,
class:
"btn btn-cancel"
app/views/groups/edit.html.haml
View file @
915315a4
...
@@ -78,6 +78,12 @@
...
@@ -78,6 +78,12 @@
.input
.input
=
f
.
text_field
:ldap_cn
,
placeholder:
"Ex. QA group"
,
class:
"xxlarge left"
=
f
.
text_field
:ldap_cn
,
placeholder:
"Ex. QA group"
,
class:
"xxlarge left"
.clearfix
=
f
.
label
:ldap_access
do
LDAP Access
.input
=
f
.
select
:ldap_access
,
options_for_select
(
UsersGroup
.
group_access_roles
,
@group
.
ldap_access
)
.form-actions
.form-actions
=
f
.
submit
'Save group'
,
class:
"btn btn-save"
=
f
.
submit
'Save group'
,
class:
"btn btn-save"
...
...
db/migrate/20130809090140_add_ldap_access_to_group.rb
0 → 100644
View file @
915315a4
class
AddLdapAccessToGroup
<
ActiveRecord
::
Migration
def
change
add_column
:namespaces
,
:ldap_access
,
:integer
,
null:
true
end
end
db/schema.rb
View file @
915315a4
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
# It's strongly recommended to check this file into your version control system.
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
2013080
2124933
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
2013080
9090140
)
do
create_table
"deploy_keys_projects"
,
:force
=>
true
do
|
t
|
create_table
"deploy_keys_projects"
,
:force
=>
true
do
|
t
|
t
.
integer
"deploy_key_id"
,
:null
=>
false
t
.
integer
"deploy_key_id"
,
:null
=>
false
...
@@ -130,6 +130,7 @@ ActiveRecord::Schema.define(:version => 20130802124933) do
...
@@ -130,6 +130,7 @@ ActiveRecord::Schema.define(:version => 20130802124933) do
t
.
string
"type"
t
.
string
"type"
t
.
string
"description"
,
:default
=>
""
,
:null
=>
false
t
.
string
"description"
,
:default
=>
""
,
:null
=>
false
t
.
string
"ldap_cn"
t
.
string
"ldap_cn"
t
.
integer
"ldap_access"
end
end
add_index
"namespaces"
,
[
"name"
],
:name
=>
"index_namespaces_on_name"
add_index
"namespaces"
,
[
"name"
],
:name
=>
"index_namespaces_on_name"
...
...
lib/gitlab/ldap/access.rb
View file @
915315a4
...
@@ -21,7 +21,7 @@ module Gitlab
...
@@ -21,7 +21,7 @@ module Gitlab
# First lets add user to new groups
# First lets add user to new groups
groups
.
each
do
|
group
|
groups
.
each
do
|
group
|
group
.
add_users
([
user
.
id
],
UsersGroup
::
DEVELOPER
)
group
.
add_users
([
user
.
id
],
group
.
ldap_access
)
if
group
.
ldap_access
.
present?
end
end
# Remove groups with LDAP if user lost access to it
# Remove groups with LDAP if user lost access to it
...
...
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