1. 程式人生 > 其它 >第五章 Gitlab許可權管理

第五章 Gitlab許可權管理

一、新增使用者

# 1. 用root 管理員登陸。

# 2. 點選管理區域
#3. 點選New User
#4. 輸入使用者相關資訊
#5. 使用者會收到郵件如下畫面,點選設定密碼即可。

二、普通使用者升級為管理員使用者

1. 使用root 使用者登入gitlab伺服器。
2. 檢視資料庫配置資訊 cat /var/opt/gitlab/gitlab-rails/etc/database.yml
3. 登入使用者 su - gitlab-psql
4. 連線庫 psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
5. 查詢使用者 select * from users where email = ‘普通使用者郵箱地址’;
6. 更新為管理員 update users set admin=‘t’ where id = 普通使用者ID;
7.在admin 檢視中驗證

三、 建立組

# 1. 使用管理員登陸gitlab伺服器。

# 2. 點選管理區域—Group-Add group 
#3. 依次填入組路徑,名稱和描述等資訊
# 4. 在如下畫面選擇使用者加入到剛建立的組、許可權等 。

四、 使用者許可權

#1. 使用管理員開啟要設定許可權的專案。
#2. 點選【Settings】--【Members】
#3. 新增完成後,如下圖所示
#4. 下表完整的列出了Guest,Reporter,Developer,Master,Owner對應的許可權。
Guest Reporter Developer Master Owner
Create new issues * * * * *
Leave comments * * * * *
Pull the project code * * * *
Download a project * * * *
Create code snippets * * * *
Create new merge requests * * *
Push changes to nonprotected branches * * *
Remove nonprotected branches * * *
Add tags * * *
Write a wiki * * *
Manage the issue tracker * * *
Add new team members * *
Push changes to protected branches * *
Manage the branch protection * *
Manage Git tags * *
Edit the project * *
Add deploy keys to the project * *
Configure the project hooks * *