Project

General

Profile

Actions

Patch #3827

open

Allow (SVN) repository browsing in Redmine.pm

Added by Stefan Rubner over 14 years ago. Updated over 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
SCM extra
Target version:
-
Start date:
2009-09-06
Due date:
% Done:

0%

Estimated time:

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.

Files

Actions

Also available in: Atom PDF