BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
8f7360f3
Commit
8f7360f3
authored
Sep 05, 2012
by
miks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API on adding users to project implemented
parent
19a52197
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
0 deletions
+39
-0
projects.md
doc/api/projects.md
+15
-0
projects.rb
lib/api/projects.rb
+12
-0
projects_spec.rb
spec/requests/api/projects_spec.rb
+12
-0
No files found.
doc/api/projects.md
View file @
8f7360f3
...
@@ -106,6 +106,21 @@ Parameters:
...
@@ -106,6 +106,21 @@ Parameters:
Will return created project with status
`201 Created`
on success, or
`404 Not
Will return created project with status
`201 Created`
on success, or
`404 Not
found`
on fail.
found`
on fail.
## Add project users
Add users to exiting project
```
PUT /projects/:id/add_users
```
Parameters:
+
`id`
(required) - The ID or code name of a project
+
`user_ids`
(required) - new project name
+
`project_access`
(required) - new project name
Will return updated project with status
`200 OK`
on success, or
`404 Not found`
on fail.
## Project repository branches
## Project repository branches
...
...
lib/api/projects.rb
View file @
8f7360f3
...
@@ -44,6 +44,18 @@ module Gitlab
...
@@ -44,6 +44,18 @@ module Gitlab
end
end
end
end
# Add users to project with specified access level
#
# Parameters:
# id (required) - The ID or code name of a project
# user_ids (required) - The ID list of users to add
# project_access (required) - Project access level
# Example Request:
# PUT /projects/:id/add_users
put
":id/add_users"
do
user_project
.
add_users_ids_to_team
(
params
[
:user_ids
],
params
[
:project_access
])
end
# Get a project repository branches
# Get a project repository branches
#
#
# Parameters:
# Parameters:
...
...
spec/requests/api/projects_spec.rb
View file @
8f7360f3
...
@@ -62,6 +62,18 @@ describe Gitlab::API do
...
@@ -62,6 +62,18 @@ describe Gitlab::API do
end
end
end
end
describe
"PUT /projects/:id/add_users"
do
@user2
=
Factory
:user
@user3
=
Factory
:user
it
"should add users to existing project"
do
expect
{
put
api
(
"/projects/
#{
project
.
code
}
/add_users"
,
user
),
user_ids:
[
@user2
.
id
,
@user3
.
id
],
project_access:
UsersProject
::
DEVELOPER
}.
to
change
{
Project
.
users_projects
.
where
(
:project_access
=>
UsersProject
::
DEVELOPER
).
count
}.
by
(
2
)
end
end
describe
"GET /projects/:id"
do
describe
"GET /projects/:id"
do
it
"should return a project by id"
do
it
"should return a project by id"
do
get
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
...
...
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