Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#4 simple per user per project permissions (patch attached)

open
nobody
None
5
2012-06-08
2012-06-08
Dave Amphlett
No

I wanted a really simple way to show or hide projects on a per user basis.
I've attached a patch I'm using to achieve this.
By default all projects are permissioned for everyone (so it should be backward compatible).

You can set restrictions, in the config in the projects array for each repos with a 'users' value. It supports a project default permission and per user overrides.

Here's an example $conf['projects']

$conf['projects'] = array(
'project1' => array(
'repo' => '/volume1/dw_git/project1.git'
),
'project2' => array(
'repo' => '/volume1/dw_git/project2.git'
),
'project3' => array(
'repo' => '/volume1/dw_git/project3.git',
'users' => array('*' => false, 'damphlett' => true), // only damphlett can see project3
),
'project4' => array(
'repo' => '/volume1/dw_git/project4.git',
'users' => array('humpty' => false), // everyone except humpty can see project4
),
);

Discussion

  • Dave Amphlett
    Dave Amphlett
    2012-06-08

    patch to index.php and inc/functions.php

     
    Attachments