`
scm002
  • 浏览: 309724 次
社区版块
存档分类
最新评论

gerrit集成gitweb所需的权限设置

 
阅读更多

在以前发的博文里提到如何在gerrit里集成gitweb
集成之后发现只有我的root用户(gerrit里注册的第一个用户)才能够点gitweb链接正常打开gitweb页面。其他的普通用户点gitweb链接显示404错误。
经过网上调查发现2.5开始使用gitweb需要有【refs/*】下所有的read权限。
参考链接1 里有下面一段话
『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.』
这是2.5-rc0发布时的一个bug。后来改掉了。修改内容看参考链接2
但是既然改了为什么我这还不行呢? 读了gerrit 2.5的release note才知道原因。Release note里有下面一句话。
『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。
最后感叹一下,Gerrit的文档真的是很少啊。调查一个问题的原因居然要看到那么多东西。。。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics