Modify ↓
#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
9 9 # Author: John Hampton <pacopablo@pacopablo.com> 10 10 11 11 from trac.perm import DefaultPermissionStore 12 from trac.config import Option13 12 14 13 __all__ = ['UserExtensiblePermissionStore'] 15 14 16 15 class UserExtensiblePermissionStore(DefaultPermissionStore): 17 16 """ Default Permission Store extended to list all ldap groups """ 18 17 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 22 18 def get_all_permissions(self): 23 19 """Return all permissions for all users. 24 20 … … 41 37 if p[1][0:1] != "@": 42 38 filteredPermissions.append(p) 43 39 40 group_nameattr = \ 41 self.config.get('account-manager', 'group_nameattr', 'cn') 44 42 all_groups = daProvider.get_all_groups() 45 43 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]) 47 45 if len(users) == 0: 48 46 users.append("(nobody)") 49 47 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]]) 51 49 52 50 self.log.debug("permissions: %s", filteredPermissions) 53 51 return filteredPermissions
Attachments (1)
Change History (4)
Changed 6 years ago by
Attachment: | t13548.patch added |
---|
comment:1 Changed 5 years ago by
Owner: | changed from bebbo to Ryan J Ollos |
---|---|
Status: | new → accepted |
comment:2 Changed 5 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Note: See
TracTickets for help on using
tickets.
In 17455: