(一)、添加用户
一、用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