官术网_书友最值得收藏!

  • Gitolite Essentials
  • Sitaram Chamarty
  • 275字
  • 2021-07-16 12:10:04

Access Control example with Gitolite

We will see how simple Access Control can be with Gitolite. First, here's an example where the junior developers (let's call them Alice and Bob here) should be prevented from rewinding or deleting any branches, while the senior developers (Carol and David) are allowed to do so:

Tip

We will see this in more detail in later chapters, but Gitolite uses a plain text file to specify the configuration, and these access rules are placed in that file.

repo foo
 RW = alice bob
 RW+ = carol david

You probably guessed that the RW stands for read and write. The + in the second rule stands for force, just as it does in the push command, and allows you to rewind or delete a branch.

Now, suppose we want the junior developers to have some specific set of branches that they should be allowed to rewind or delete, a sort of "sandbox", if you will. The following command will help you to implement that:

 RW+ sandbox/ = alice bob

Alice and Bob can now push, rewind, or delete any branches whose names start with sandbox/.

Access Control at the repository level is even easier, and you may even have guessed what that looks like:

repo foo
 RW+ = alice
 R = bob

repo bar
 RW+ = bob
 R = alice

repo baz
 RW+ = carol
 R = alice bob

As you can see, you have three users with different access permissions for each of the three repositories. Doing this using the file systems' permissions mechanisms or POSIX ACLs would be doable, but quite cumbersome to set up and to audit/review.

主站蜘蛛池模板: 济宁市| 崇明县| 齐齐哈尔市| 临泽县| 罗城| 德格县| 金坛市| 浏阳市| 延川县| 普安县| 紫金县| 通河县| 江川县| 纳雍县| 恩施市| 怀集县| 余庆县| 正宁县| 新邵县| 故城县| 株洲市| 东台市| 舟山市| 牙克石市| 招远市| 承德市| 河津市| 九江县| 临潭县| 启东市| 永州市| 新田县| 通榆县| 大方县| 宝丰县| 东平县| 石台县| 缙云县| 桂平市| 灌阳县| 甘洛县|