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
b22546df
Commit
b22546df
authored
Aug 13, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ldap_groups
parent
22b0b2b4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
3 deletions
+36
-3
app/models/group.rb
app/models/group.rb
+1
-0
app/models/ldap_group.rb
app/models/ldap_group.rb
+5
-0
db/migrate/20140813090117_add_ldap_groups_table.rb
db/migrate/20140813090117_add_ldap_groups_table.rb
+21
-0
db/schema.rb
db/schema.rb
+9
-3
No files found.
app/models/group.rb
View file @
b22546df
...
...
@@ -21,6 +21,7 @@ class Group < Namespace
has_many
:users
,
through: :users_groups
has_many
:project_group_links
,
dependent: :destroy
has_many
:shared_projects
,
through: :project_group_links
,
source: :project
has_many
:ldap_groups
,
foreign_key:
'group_id'
validates
:ldap_access
,
inclusion:
{
in:
UsersGroup
.
group_access_roles
.
values
},
...
...
app/models/ldap_group.rb
0 → 100644
View file @
b22546df
class
LdapGroup
<
ActiveRecord
::
Base
belongs_to
:group
validates
:cn
,
uniqueness:
{
scope: :group_id
}
end
db/migrate/20140813090117_add_ldap_groups_table.rb
0 → 100644
View file @
b22546df
class
AddLdapGroupsTable
<
ActiveRecord
::
Migration
def
up
create_table
:ldap_groups
do
|
t
|
t
.
string
:cn
,
null:
false
t
.
integer
:group_access
,
null:
false
t
.
references
:group
,
null:
false
t
.
timestamps
end
Group
.
where
.
not
(
ldap_cn:
nil
).
each
do
|
group
|
group
.
ldap_groups
.
where
(
cn:
group
.
ldap_cn
).
first_or_create
do
|
ldap_group
|
ldap_group
.
group_access
=
group
.
ldap_access
end
end
end
def
down
drop_table
:ldap_groups
end
end
db/schema.rb
View file @
b22546df
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2014081
115512
7
)
do
ActiveRecord
::
Schema
.
define
(
version:
2014081
309011
7
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -128,6 +128,14 @@ ActiveRecord::Schema.define(version: 20140811155127) do
add_index
"keys"
,
[
"user_id"
],
name:
"index_keys_on_user_id"
,
using: :btree
create_table
"ldap_groups"
,
force:
true
do
|
t
|
t
.
string
"cn"
,
null:
false
t
.
integer
"group_access"
,
null:
false
t
.
integer
"group_id"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
end
create_table
"merge_request_diffs"
,
force:
true
do
|
t
|
t
.
string
"state"
t
.
text
"st_commits"
...
...
@@ -137,8 +145,6 @@ ActiveRecord::Schema.define(version: 20140811155127) do
t
.
datetime
"updated_at"
end
add_index
"merge_request_diffs"
,
[
"merge_request_id"
],
name:
"index_merge_request_diffs_on_merge_request_id"
,
unique:
true
,
using: :btree
create_table
"merge_requests"
,
force:
true
do
|
t
|
t
.
string
"target_branch"
,
null:
false
t
.
string
"source_branch"
,
null:
false
...
...
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