CentOS Stream 8
Sponsored Link

Git : Gitolite : アクセス権の設定2021/06/18

 
リポジトリのアクセス権の設定です。作業は Gitolite 管理者で実施します。
[1] 例として、[project01] リポジトリに [cent] ユーザーのみ読み書き権限 (リビジョンを戻す権限含めて) を付与します。
[gitolite3@dlp ~]$
cd ~/gitolite-admin/conf

[gitolite3@dlp conf]$
vi gitolite.conf
# 最終行に追記

# ユーザー名の指定はユーザーの SSH 鍵のファイル名

# [+] 付加で リビジョンを戻す権限も含む

repo project01
    RW+     =   id_cent

[gitolite3@dlp conf]$
git commit -a -m "Change Permission for project01"

[master cd9c8ad] Change Permission for project01
 1 file changed, 1 insertion(+), 1 deletion(-)

[gitolite3@dlp conf]$
git push

Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 2 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 374 bytes | 374.00 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0), pack-reused 0
To ssh://GitServer/gitolite-admin
   bd3bff0..cd9c8ad  master -> master
[2] 例として、[project02] リポジトリに [developer] グループのみ読み書き権限を付与します。
[gitolite3@dlp ~]$
cd ~/gitolite-admin/conf

[gitolite3@dlp conf]$
vi gitolite.conf
# 最終行に追記

@developer = id_cent id_redhat

repo project02
    RW      =   @developer

[gitolite3@dlp conf]$
git commit -a -m "Change Permission for project02"

[master 929736f] Change Permission for project02
 1 file changed, 5 insertions(+)

[gitolite3@dlp conf]$
git push

Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 2 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 442 bytes | 442.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Initialized empty Git repository in /var/lib/gitolite3/repositories/project02.git/
To ssh://GitServer/gitolite-admin
   cd9c8ad..929736f  master -> master
[3] 例として、[project03] リポジトリに 以下のようなアクセス権を付与します。
・全ユーザーに読み取り権限
・[id_redhat] は全ブランチに読み書き権限
・[developer2] グループは [develop] ブランチに読み書き権限
・[deployer] グループは [release] ブランチに読み書き権限
[gitolite3@dlp ~]$
cd ~/gitolite-admin/conf

[gitolite3@dlp conf]$
vi gitolite.conf
# 最終行に追記

@developer2 = id_cent id_fedora
@deployer = id_debian id_ubuntu

repo project03
    R           =  @all
    RW          =  id_redhat
    RW develop  =  @developer2
    RW release  =  @deployer

[gitolite3@dlp conf]$
git commit -a -m "Change Permission for project03"

[master ed6fe56] Change Permission for project03
 1 file changed, 9 insertions(+)

[gitolite3@dlp conf]$
git push

Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 2 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 502 bytes | 251.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Initialized empty Git repository in /var/lib/gitolite3/repositories/project03.git/
To ssh://GitServer/gitolite-admin
   929736f..ed6fe56  master -> master
関連コンテンツ