(一)、添加用戶
一、用root管理員登錄,點擊管理區域
二、點擊New User,並輸入相關的信息。
三、點擊肯定後輸入相關的密碼git
(二)、建立組
一、點擊管理區域,選擇組
二、依次編輯相關的帳號信息
三、編輯組,並添加相應的用戶sql
能夠經過輸入名字選擇要分配權限的小組成員,而後分配角色,選擇權限有效時間,點擊Add to Project就把人員拉近到項目中。GitLab的角色有如下四種:socket
Guest:能夠建立issue、發表評論,不能讀寫版本庫
Reporter:能夠克隆代碼,不能提交,能夠賦予測試、產品經理此權限
Developer:能夠克隆代碼、開發、提交、push,能夠賦予開發人員此權限
MainMaster:能夠建立項目、添加tag、保護分支、添加項目成員、編輯項目,通常GitLab管理員或者CTO纔有此權限ide
(三)、建立項目並分配相關的權限
一、單擊項目,並建立項目
二、給該項目選擇成員或組,並分配相應的角色。具體以下,進入項目---setting---members---指定用戶或組分配權限和角色----最後添加到項目中。gitlab
三、查看相關的權限post
後續:強制禁用gitlab的雙因子認證:Two-Factor Authentication,若是不由用的話,什麼都作不成。測試
具體解決方法以下:
一、查看gitlab安裝時的postgresql的相關信息ui
[root@otrs004097 ~]# cat /var/opt/gitlab/gitlab-rails/etc/database.yml # This file is managed by gitlab-ctl. Manual changes will be # erased! To change the contents below, edit /etc/gitlab/gitlab.rb # and run `sudo gitlab-ctl reconfigure`. production: adapter: postgresql encoding: unicode collation: database: gitlabhq_production pool: 10 username: "gitlab" password: host: "/var/opt/gitlab/postgresql" port: 5432 socket: sslmode: sslcompression: 0 sslrootcert: sslca: load_balancing: {"hosts":[]} prepared_statements: false statements_limit: 1000 fdw:
二、鏈接到gitlabhq_production庫postgresql
[root@otrs004097 ~]# su - gitlab-psql Last login: Tue Nov 26 15:21:31 CST 2019 on pts/0 -sh-4.2$ psql -h /var/opt/gitlab/postgresql -d gitlabhq_production psql (10.9) Type "help" for help. gitlabhq_production=# \l gitlabhq_production=# SELECT name,username,otp_required_for_login,two_factor_grace_period, require_two_factor_authentication_from_group FROM users; name | username | otp_required_for_login | two_factor_grace_period | require_two_factor_authentication_from_group ---------------+----------+------------------------+-------------------------+---------------------------------------------- yw | yw | f | 48 | f lqb | lqb | f | 48 | t ops | yunwei | f | 48 | f dev | dev1 | f | 48 | f test | test1 | f | 48 | f Administrator | root | f | 48 | f (6 rows) gitlabhq_production=# UPDATE users set require_two_factor_authentication_from_group = 'f' WHERE username = 'root'; UPDATE 1