On 09/05/2012 09:27 AM, sujan54004 wrote:
>
> Hi,
>
> Thanks a lot for the reply.
> I checked out unixgroups plugin but it seems to be slow and doesn't work for
> me as well. I was thinking of something that lets us manage the the users
> from trac only. Permissions for unix groups and trac user groups are
> different.
> I am trying to install TracForge but I'm still not successful. Do you have
> some idea if TracForgePlugin works well for Trac 12.03.
>
We have patched it and this is our code, maybe it is useful:
{{{
from pwd import *
from grp import *
from trac.core import *
from trac.perm import IPermissionGroupProvider
class UnixGroups(Component):
implements(IPermissionGroupProvider)
# IPermissionGroupProvider methods
def get_permission_groups(self, username):
try:
maingroup = getgrgid(getpwnam(username).pw_gid).gr_name
except KeyError:
return []
othergroups = [g.gr_name for g in getgrall() if username in g.gr_mem]
return [maingroup] + othergroups