黄色网页视频 I 影音先锋日日狠狠久久 I 秋霞午夜毛片 I 秋霞一二三区 I 国产成人片无码视频 I 国产 精品 自在自线 I av免费观看网站 I 日本精品久久久久中文字幕5 I 91看视频 I 看全色黄大色黄女片18 I 精品不卡一区 I 亚洲最新精品 I 欧美 激情 在线 I 人妻少妇精品久久 I 国产99视频精品免费专区 I 欧美影院 I 欧美精品在欧美一区二区少妇 I av大片网站 I 国产精品黄色片 I 888久久 I 狠狠干最新 I 看看黄色一级片 I 黄色精品久久 I 三级av在线 I 69色综合 I 国产日韩欧美91 I 亚洲精品偷拍 I 激情小说亚洲图片 I 久久国产视频精品 I 国产综合精品一区二区三区 I 色婷婷国产 I 最新成人av在线 I 国产私拍精品 I 日韩成人影音 I 日日夜夜天天综合

Subversion權(quán)限控制手冊(cè)

系統(tǒng) 2140 0

在文章《 Subversion 詳細(xì)說(shuō)明 》中,我們?cè)?jīng)建立了一個(gè)版本控制倉(cāng)庫(kù),現(xiàn)在打開(kāi)這個(gè)版本控制倉(cāng)庫(kù),讓我們來(lái)看看這個(gè)目錄結(jié)構(gòu),

我們會(huì)在目錄結(jié)構(gòu)中找到一個(gè)叫做conf的文件夾,打開(kāi)這個(gè)文件夾,你會(huì)看到三個(gè)文件,分別叫做authz,passwd,svnserve.conf。

下面我們就來(lái)介紹一下這三個(gè)文件的作用格式什么。
首先,我們介紹passwd這個(gè)文件。
用你習(xí)慣的文本編輯器打開(kāi)這個(gè)文件,你會(huì)看到一些使用“#”注釋掉的說(shuō)明,其中關(guān)鍵的就是在[users]下面,有
# harry = harryssecret
# sally = sallyssecret
樣的樣板代碼,意思就是有兩個(gè)用戶,其中一個(gè)的用戶名叫“harry”,密碼為“harryssecret”,而另一個(gè)用戶名為“sally”,密碼為“sallyssecret”。我們接下來(lái)為我們的測(cè)試下面添加一些用戶,這樣方便我們下面的說(shuō)明。比如,我要添加三個(gè)用戶,一個(gè)叫做“nicholas”,密碼為“nicholas”,第二個(gè)用戶名為“friend”,密碼為“friend”,第三個(gè)為“stranger”,密碼為“strangers”。
代碼如下:
nicholas = nicholas
friend = friend
???????? stranger = stranger
這樣,我們就添加好了三個(gè)認(rèn)證用戶。

### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.
?
[users]
# harry = harryssecret
# sally = sallyssecret
nicholas = nicholas
friend = friend
stranger = stranger
?
?????? 下面,我們來(lái)介紹authz這個(gè)文件,這個(gè)文件是控制 權(quán)限 的關(guān)鍵。
同樣打開(kāi)這個(gè)文件,你會(huì)看到一些注釋掉的語(yǔ)句,
# [groups]
# [/foo/bar]
# [repository:/baz/fuz]
?????? 下面,我們介紹一下用戶組的概念。所謂用戶組,顧名思義,就是一個(gè)成員組,一般情況下,在同一個(gè)成員組的人員享有同樣的權(quán)力,比如讀,寫(xiě)權(quán)。 Subversion 為我們提供了一個(gè)很好的用戶組應(yīng)用。
在之前,我們一共建立三個(gè)用戶,nicholas,friend和stranger,我們現(xiàn)在設(shè)想一下我們的組情況,假設(shè)我們希望nicholas和friend在開(kāi)發(fā)組中,這兩個(gè)用戶具有讀和寫(xiě)的權(quán)力,而用戶stranger在測(cè)試組中,只具備讀的權(quán)力。那么我們?cè)撊绾蝸?lái)控制這個(gè) 權(quán)限 呢?看看下面的代碼:
我們先在[groups]標(biāo)記下面,輸入組的名稱:
?????? dev_group = nicholas, friend
?????? test_group = stranger
到目前為止,我們已經(jīng)為三個(gè)用戶分好了用戶組,其中nicholas和friend在dev_group中,而stranger則在test_group中。
下面,我們?yōu)閮蓚€(gè)組來(lái)分配 權(quán)限
首先我們要為這兩個(gè)組所能訪問(wèn)的工程做一個(gè)規(guī)定,正如在之前的文章《 Eclipse 中使用 Subversion 進(jìn)行版本控制 》中,曾經(jīng)向版本參考提交了一個(gè)名為“TestSVNProj”的項(xiàng)目,下面我就假設(shè)剛剛建立的兩個(gè)用戶組都需要最這個(gè)工程進(jìn)行操作。
我們?cè)赼uthz文件中,寫(xiě)下[TestSVNProj],這個(gè)是指定我們下面將對(duì)TestSVNProj項(xiàng)目進(jìn)行定義。
我們使用如下代碼:
@dev_group = rw
@test_group = r
這就定義了,對(duì)TestSVNProj項(xiàng)目,dev_group用戶組可以進(jìn)行讀,寫(xiě)操作,而test_group用戶組則只具備讀的 權(quán)限
為了阻止其他用戶組對(duì)這個(gè)文件有讀的權(quán)力,我們可以再添加一句:
* =
這個(gè)語(yǔ)句就是指定其他的用戶組的權(quán)力為空,也就是沒(méi)有權(quán)力。

### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to a
### single user, to a group of users defined in a special [groups]
### section, or to anyone using the '*' wildcard.?Each definition can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').
?
[groups]
# harry_and_sally = harry,sally
?
dev_group = nicholas,friend
test_group = stranger
?
# [/foo/bar]
# harry = rw
# * =
?
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
?
[/TestSVNProj]
@dev_group = rw
@test_group = r
* =
?
最后,我們?cè)趤?lái)說(shuō)說(shuō)這個(gè)svnserve.conf文件,打開(kāi)這個(gè)文件,我們就可以看出這個(gè)是 Subversion 權(quán)限 配置的主文件,類似于讀取相關(guān)信息的樞紐。
為了讓我們剛剛配置的兩個(gè)文件(passwd和authz)起作用,我們需要去掉password-db = passwd和authz-db = authz前面的注釋符“#”,讓 Subversion 知道要從上面兩個(gè)文件中讀取相關(guān)信息。
當(dāng)然,你也可以指定其他的認(rèn)證文件,寫(xiě)法如下:
??????? password-db = ..\..\passwd
authz-db = ..\..\authz
以此類推。
?????? 在實(shí)戰(zhàn)過(guò)程中,處于安全的考慮,我們往往要限制對(duì)匿名用戶的訪問(wèn) 權(quán)限 ,所以我們可以將anon-access = read前面的“#”去掉,并將read參數(shù)修改為none,表明禁止匿名用戶對(duì)版本控制庫(kù)的訪問(wèn)。

### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.?(If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)
?
### Visit http:// subversion .tigris.org/ for more information.
?
[general]
### These options control access to the repository for unauthenticated
### and authenticated users.?Valid values are "write", "read",
### and "none".?The sample settings below are the defaults.
anon-access = none
# auth-access = write
### The password-db option controls the location of the password
### database file.?Unless you specify a path starting with a /,
### the file's location is relative to the conf directory.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control.?Unless you specify a path
### starting with a /, the file's location is relative to the conf
### directory.?If you don't specify an authz-db, no path-based access
### control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.?The default realm
### is repository's uuid.
# realm = My First Repository
?
?????? 至此,你可以控制你的項(xiàng)目,對(duì)其進(jìn)行訪問(wèn) 權(quán)限 的控制了。

Subversion權(quán)限控制手冊(cè)


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論