Gerrit集成Gitweb,普通成員沒有查看權限

Gerrit集成Gitweb沒有查看權限問題

情景復現

gerrit集成gitweb後,系統管理員有權限進去gitweb,其他成員進去都是not found。

問題分析

除了管理員之外,其他權限組成員都無法查看gitweb的信息。嘗試給小組成員分配各個屬性,包括可以查看數據庫database的權限,問題依舊。

看來查看gitweb的權限與數據庫訪問並沒有關係;翻牆出去在谷歌官網FAQ查找到了這麼一段話:『This is due to a change on the level of security applied by GitServlet: now the GitWeb makes sure that the user has full access to ALL branches (refs/meta/config included) otherwise it returns a 404。
The problem is: repo owner and gerrit administrator has implicit access to refs/meta/config … and thus an extra bit is need on the if() checking permissions.』。
看來gitweb的權限需要具備ref/*節點下面的read權限,『Make read access to refs/meta/config by default exclusive to project owners 』這個設定做在了All-Projects的ACL設定裏,所以缺省被所有的Project繼承。
解決方案

在單獨項目的ACL裏爲項目的用戶組增加了對refs/meta/config的read權限。用戶可以正常顯示gitweb頁面。

不良影響

原來gerrit是用git做自身的ACL管理的,因此所有對refs/meta/config有read權限的用戶都可以在Project的Access頁面裏修改權限,修改後雖然不能直接submit,
但是可以作爲patch提交review。而且通過gitweb就能夠看到project.config和groups文件的全部內容,知道當前項目是如何設置權限的。

這樣是否合適就仁者見仁智者見智了。另外,對於用戶提交的關於權限修改的patch如果想commit的話需要對refs/meta/config做和refs/heads/*一樣的權限設定,
也就說需要Label Code-Review,Label Verified,Submit三個權限纔有可能commit patch。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章