xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
<root> / docs / rights.txt (4f6db73c2109be16054974b2da1c1de895448388) (1,059B) (mode 100644) [raw]
This document tries to explain the rights management.

We have a table for all rights types.
There are types for user, repo, refs etc.

The table has the following fields:
	right_id - auto increment field, needed for editing and deletion.
	rights - text, one letter means one right
	misc, misc2: these are used for refs and path for 'refs' type.
		Other types may used these fields.
	who - Who gave the rights (uid).
	prio - Priority of the right (for evaluation ascending ordering)
	uid - uid of the user that the rights were granted to.
	obj_id - opaque id of a resource. It may be the repo_id or the user_id.

We have some function to manage the rights:
-rg_rights_set($db, $right_id, $who, $type, $obj_id, $uid, $rights,
	$misc, $ip, $prio)
	Sets the rights for a type-uid-obj_id combination.

- rg_rights_load($db, $type, $obj_id)
	Loads all rights for an object, identified by
	type and obj_id; type may be '*' for all rights type.

- rg_rights_delete_list($db, $type, $obj_id, $list)
	Deletes a list of rights,
	obtained by selecting them in the form.
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master