jakubgarfield / Bonobo-Git-Server

Bonobo Git Server for Windows is a web application you can install on your IIS and easily manage and connect to your git repositories. Go to homepage for release and more info.
http://bonobogitserver.com
MIT License
1.81k stars 603 forks source link

feature request: read only access to repositories #798

Closed joerg1985 closed 9 months ago

joerg1985 commented 6 years ago

We are using Bonobo Git Server with authenticated users only, we had some pushes to repositories by error. Now we would like to give some teams / users only read access to some repositories.

Currently it is only possible to grant read and write rights to a user or team. Is it possible to change this in a future version of Bonobo Git Server?

Kind regards

chkpnt commented 9 months ago

You could write a pre-receive hook script, which rejects the push, if the user isn't authorized.

Several environment variables are available for the script to implement this task:

AUTH_USER="userid@example.com"
AUTH_USER_DISPLAYNAME="John Doe"
AUTH_USER_ROLES="..."
AUTH_USER_TEAMS="..."
...
REMOTE_USER="userid@example.com"
joerg1985 commented 9 months ago

@chkpnt thanks for the hint.