Rest api does not allow non-admin users to create repositories with userrepo plugin configured

Issue #682 resolved
Seth Gray
created an issue

403 forbidden exception is received when you attempt to use rest api (api/rest/repositories) post method to create repository with a user who is configured to be able to create repositories via the userrepo plugin. If I change this user to admin, the user can create repository ok, however I really don't want this user to be an admin as its only being used as a repository mirroring user.

Steps to repro:

  1. Install and configure userrepo plugin.
  2. Confirm non-admin can create repository via web UI
  3. As non-admin, create repository via post of repositoryresource in rest api.
  4. 403 forbidden exception occurs.
  5. Change user to admin. Try again
  6. Operation succeeds.
Sample fiddler post
POST XXX/api/rest/repositories HTTP/1.1
Accept: application/JSON
Authorization: Basic XXXXXXX
User-Agent: Mozilla/5.0 (Windows NT; Windows NT 6.1; en-US) WindowsPowerShell/4.0
Content-Type: application/JSON
Host: XXXX
Content-Length: 175

{
      "name":  "testrepository",
    "type":  "hg"
}

Comments (7)

  1. Log in to comment