Patch #3827
Allow (SVN) repository browsing in Redmine.pm
| Status: | New | Start date: | 2009-09-06 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% | |
| Category: | SCM extra | |||
| Target version: | - |
Description
Currently, you cannot enable repository browsing (SVNListParentPath ...) when using Redmine.pm to grant/deny access to the various SVN repositories. The reason for that is that there obviously is no project_id for the svn root directory and thus, access is denied.
I fixed that by changing the function is_public_project in Redmine.pm like this:
sub is_public_project {
my $project_id = shift;
my $r = shift;
my $ret = 0;
if ($project_id) {
my $dbh = connect_database($r);
my $sth = $dbh->prepare(
"SELECT * FROM projects WHERE projects.identifier=? and projects.is_public=true;"
);
$sth->execute($project_id);
$ret = $sth->fetchrow_array ? 1 : 0;
$sth->finish();
$dbh->disconnect();
} else {
$ret = 1;
}
$ret;
}
<pre>
This will allow access if the project_id is empty, and use the normal access checks otherwise. I don't know whether this will have side effects on other types of repositories like git, bzr, etc.
This patch should work for the curent stable version as well as for the current trunk.
History
#1 Updated by Felix Schäfer over 3 years ago
Please keep in mind here that this exposes the names of all svn repositories, so users will see the names of all projects, even the ones that are not public and they don't have rights on.
#2 Updated by Toshi MARUYAMA over 2 years ago
- Category set to SCM
#3 Updated by Toshi MARUYAMA about 2 years ago
- Category changed from SCM to SCM extra
#4 Updated by Bruno Medeiros 6 days ago
I would like to use SVNListParentPath on, any thoughts on how to implement it properly? Is there any way to filter repositories before show?
My personal case is that all users from my company (users authenticated by our LDAP server) can see all projects, and all other users (users authenticated by redmine's internal database) cannot see any project. Maybe doing that via apache would be more feasible...