summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/gl_objects/projects.py4
-rw-r--r--gitlab/v4/objects.py16
2 files changed, 20 insertions, 0 deletions
diff --git a/docs/gl_objects/projects.py b/docs/gl_objects/projects.py
index 1b0a6b9..7908416 100644
--- a/docs/gl_objects/projects.py
+++ b/docs/gl_objects/projects.py
@@ -101,6 +101,10 @@ member.delete()
project.share(group.id, gitlab.DEVELOPER_ACCESS)
# end share
+# unshare
+project.unshare(group.id)
+# end unshare
+
# hook list
hooks = project.hooks.list()
# end hook list
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 69c3185..16564e4 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -2672,6 +2672,22 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
'expires_at': expires_at}
self.manager.gitlab.http_post(path, post_data=data, **kwargs)
+ @cli.register_custom_action('Project', ('group_id', ))
+ @exc.on_http_error(exc.GitlabDeleteError)
+ def unshare(self, group_id, **kwargs):
+ """Delete a shared project link within a group.
+
+ Args:
+ group_id (int): ID of the group.
+ **kwargs: Extra options to send to the server (e.g. sudo)
+
+ Raises:
+ GitlabAuthenticationError: If authentication is not correct
+ GitlabDeleteError: If the server failed to perform the request
+ """
+ path = '/projects/%s/share/%s' % (self.get_id(), group_id)
+ self.manager.gitlab.http_delete(path, **kwargs)
+
# variables not supported in CLI
@cli.register_custom_action('Project', ('ref', 'token'))
@exc.on_http_error(exc.GitlabCreateError)