4, SVN learning svn permission settings

In a project, there are multiple members developing together, and the modules they are responsible for are not the same, so the permissions assigned to them by svn should also be different to prevent the modules responsible for zhangsan from being modified by lisi and causing trouble.

1. Suppose the company wants to develop a project named cms and use svn for version control. The svn administrator will first create a cms factory in the root directory of svn. The command is as follows:

 2. The project manager will create a new cms project on his own computer, and establish the basic structure of the project. If the cms project, there are three folders: UI development, code development, and test testing. There are html development and js development under UI development. There is another file in each directory. As shown below:

 

 3. Open password-db = passwd authz-db = authz in the svnserve.conf file by the svn administrator, that is, remove the preceding # sign. password-db = passwd means that the data corresponding to the user's password is stored in the passwd file. authz-db = authz Some permission information is stored in the file authz. Open the file passwd and add user information to it, as shown in the following figure:

 

 4. Open the file authz, and set the group and corresponding permissions in it. The added content is as follows: where g_admin=admin means that the admin user belongs to the authority group g_admin, g_ui=zhangsan, lisi means zhangsan, and lisi belongs to the authority group g_ui; g_code=wangwu means that wangwu belongs to the authority group g_code; g_test =zhaoliu,qianqi means that zhaoliu,qianqi belongs to the permission group g_test. [/]
@g_admin=rw *=r means that the authority group g_admin has read and write authority to all directories. Other users only have read (r) permissions. [/ui/html] zhangsan=rw means: zhangsan has read and write permissions to the directory /ui/html. [/ui/js] lisi=rw means that lisi has read and write permissions to the directory /ui/js. [/code] @g_code=rw means that the g_code permission group has read and write permissions to the directory /code. [/test] @g_test=rw means that the g_test permission group has read and write permissions to the directory /test. 

g_admin=admin
g_ui=zhangsan,lisi
g_code=wangwu
g_test=zhaoliu,qianqi

[/]
@g_admin=rw
*=r
[/ ui / html]
zhangsan=rw
[/ui/js]
lisi=rw
[/code]
@g_code=rw
[/test]
@g_test=rw

 

 5. After the project manager creates the corresponding project locally, right-click the mouse in the blank area and select Import, as shown in the following figure:

 After clicking, the corresponding box as shown in the figure below appears, click OK 

 
 and then a dialog box for logging in will appear, add here admin username and password.

  After clicking OK, the corresponding project information will be transmitted to the cms factory of the svn server. As shown below


 
 6. It is assumed that there is a directory D:\study_source\svn\cms_d\admin locally, which is the computer of the assumed project manager. If the project manager wants to operate and code the cms project, he must first download the project cms from the svn server to the local. The directory shown in the figure below is assumed to be the project manager's computer. 

  The project manager only needs to right-click on the opened folder, and then select SVN Checkout, as shown in the following figure:

 Then enter the information shown in the following figure in the pop-up dialog box: 

 After clicking OK, as shown in the following figure:

 

 7. The project manager creates a new file 2.code in the code folder, as shown in the following figure:  

 Then right-click in the blank area and select svn commit in the menu that appears. In the dialog box that appears, as shown in the figure below:

 Click After ok, you can add a file. Project managers can operate on any folder and its contents.

 

8. Suppose there is also a file directory of lisi, D:\study_source\svn\cms_d\lisi, like the project manager, first checkout the content of the cms project from the svn server to the local, and then let lisi add a file under the directory code 3.code, right-click in the blank space and select SVN commit after the addition is complete, the following menu will appear:

 

After clicking Ok, as shown below:



 This will prompt an error. The reason is that lisi only has read and write permissions to the ui/js directory, and other directories only have read permissions. It is obviously wrong to add a file to the code directory here. With this principle, all directories can be classified and treated, so as to obtain the effect of permission control.

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326689343&siteId=291194637
svn