Commit Graph

13 Commits

Author SHA1 Message Date
Nick Thomas 3ed80a0176 Enforce the fork_project permission in Projects::CreateService
Projects::ForkService delegates to this service almost entirely, but needed
one small change so it would propagate create errors correctly.

CreateService#execute needs significant refactoring; it is now right at the
complexity limit set by Rubocop. I avoided doing so in this commit to keep the
diff as small as possible.

Several tests depend on the insecure behaviour of ForkService, so fi them up at
the same time.
2016-09-27 13:17:56 +01:00
Rémy Coutable 7458126111 API: Return 404 when trying to fork to unaccessible namespace
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-22 12:15:45 +02:00
Olaf Tomalka 636db1515c Higher code quality for fork to namespace API 2016-09-06 23:51:08 +02:00
Olaf Tomalka 3aa40153e0 Improved code quality on API fork namespace feature 2016-09-06 10:52:42 +02:00
Olaf Tomalka bad3fb895c Added fork API paremeter for a specific namespace
Browser interface allows forking to an owned grup.
This commit brings API up to speed by providing optional namespace
parameter to fork API. This allows forking to users and groups under
forker's control using their id or unique name.

Fixes #21591
2016-09-06 04:16:14 +02:00
tiagonbotelho 1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Z.J. van de Weg abca19da8b Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
Robert Speicher de944c914b Add traits for each access_level to ProjectMember factory 2016-03-06 16:53:22 -05:00
Robert Speicher 15a05be70d Fix Style/Blocks cop violations 2015-06-22 16:00:54 -04:00
Douwe Maan 0cf76a0b70 Use Projects::CreateService to fork projects so that after-create hooks are run. 2015-04-24 22:58:27 +02:00
Jeroen van Baarsen 0c4a70a306 Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 19:17:35 +01:00
Marin Jankovski 0da5154b5a Fix api tests. 2014-12-30 15:40:11 +01:00
Bernhard Kaindl f030ee846e API: Initial support for forking a project via the API
This change adds POST /projects/fork/:id to the API for forking
a project into the namespace of the authenticated user, like the
"create fork" link in the GUI does. It also calls the same code.

Failure and permission checks (except for conflict) are already
implemented and handled in ForkService and the API, so the added
code is simple and does not alter anything.
2014-10-01 10:27:48 +02:00