Modify

Opened 6 months ago

Closed 2 months ago

Last modified 2 months ago

#13548 closed defect (fixed)

Duplicated option

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Component: DirectoryAuthPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

The option group_nameattr is duplicated in api.py and auth.py.

Untested patch:

  • tracext/dirauth/api.py

     
    99# Author: John Hampton <pacopablo@pacopablo.com>
    1010
    1111from trac.perm import DefaultPermissionStore
    12 from trac.config import Option
    1312
    1413__all__ = ['UserExtensiblePermissionStore']
    1514
    1615class UserExtensiblePermissionStore(DefaultPermissionStore):
    1716    """ Default Permission Store extended to list all ldap groups """
    1817
    19     group_nameattr = Option('account-manager', 'group_nameattr', 'cn',
    20                              "Specify the attribute to read the group name. Defaults to 'cn'. For full group names use 'dn'.")
    21 
    2218    def get_all_permissions(self):
    2319        """Return all permissions for all users.
    2420
     
    4137            if p[1][0:1] != "@":
    4238                filteredPermissions.append(p)
    4339
     40        group_nameattr = \
     41                self.config.get('account-manager', 'group_nameattr', 'cn')
    4442        all_groups = daProvider.get_all_groups()
    4543        for g in all_groups:
    46             users = daProvider.get_group_users(g[1][self.group_nameattr][0])
     44            users = daProvider.get_group_users(g[1][group_nameattr][0])
    4745            if len(users) == 0:
    4846                users.append("(nobody)")
    4947            for u in users:
    50                 filteredPermissions.append([u, "@%s" % g[1][self.group_nameattr][0]])
     48                filteredPermissions.append([u, "@%s" % g[1][group_nameattr][0]])
    5149
    5250        self.log.debug("permissions: %s", filteredPermissions)
    5351        return filteredPermissions

Attachments (1)

t13548.patch (1.6 KB) - added by Ryan J Ollos 6 months ago.

Download all attachments as: .zip

Change History (4)

Changed 6 months ago by Ryan J Ollos

Attachment: t13548.patch added

comment:1 Changed 2 months ago by Ryan J Ollos

Owner: changed from bebbo to Ryan J Ollos
Status: newaccepted

comment:2 Changed 2 months ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 17455:

Remove duplicated option

Fixes #13548.

Last edited 2 months ago by Ryan J Ollos (previous) (diff)

comment:3 Changed 2 months ago by anonymous

thanks :-)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.