Skip to content
Snippets Groups Projects
Commit d0762f87 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets Committed by Wes Gurney
Browse files

API: new feature - remove group

parent 4ddd316a
No related branches found
No related tags found
1 merge request!4954Add support to configure webhook_timeout in gitlab.yaml
This commit is part of merge request !4954. Comments created here will be created in the context of that merge request.
Loading
Loading
@@ -57,6 +57,19 @@ Parameters:
+ `project_id` (required) - The ID of a project
 
 
## Remove group
Removes group with all projects inside.
```
DELETE /groups/:id
```
Parameters:
+ `id` (required) - The ID of a user group
## Group members
 
 
Loading
Loading
Loading
Loading
@@ -7,12 +7,14 @@ module API
helpers do
def find_group(id)
group = Group.find(id)
if current_user.admin or current_user.groups.include? group
if can?(current_user, :read_group, group)
group
else
render_api_error!("403 Forbidden - #{current_user.username} lacks sufficient access to #{group.name}", 403)
end
end
def validate_access_level?(level)
Gitlab::Access.options_with_owner.values.include? level.to_i
end
Loading
Loading
@@ -64,6 +66,19 @@ module API
present group, with: Entities::GroupDetail
end
 
# Remove group
#
# Parameters:
# id (required) - The ID of a group
# Example Request:
# DELETE /groups/:id
delete ":id" do
group = find_group(params[:id])
authorize! :manage_group, group
group.destroy
end
# Transfer a project to the Group namespace
#
# Parameters:
Loading
Loading
@@ -132,7 +147,6 @@ module API
member.destroy
end
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment