Opened 16 years ago
Last modified 5 years ago
#5191 new defect
[Patch] New users do not appear in members-list
Reported by: | anonymous | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | SvnAuthzAdminPlugin |
Severity: | normal | Keywords: | user list |
Cc: | dmcr@… | Trac Release: | 0.11 |
Description
After adding a few new users with the accountmanagers plugin these new users do not appear in the list of groupsmembers in the svnauthz plugin.
Attachments (0)
Change History (14)
comment:1 Changed 16 years ago by
Component: | SELECT A HACK → SvnAuthzAdminPlugin |
---|---|
Owner: | changed from anonymous to Kis Gergely |
comment:2 Changed 16 years ago by
Type: | enhancement → defect |
---|
comment:3 Changed 15 years ago by
comment:4 Changed 15 years ago by
comment:5 Changed 15 years ago by
This's my solution to get all users from session, this will list all users that exists in the session table in the trac database.
I don't think this is the best way, but it works for me.
-
svnauthz/admin_ui.py
310 310 311 311 def _get_all_users(self): 312 312 """ 313 Fetches all users/groups from PermissionSystem313 Fetches all users/groups from session 314 314 """ 315 perm = PermissionSystem(self.env) 315 db = self.env.get_db_cnx() 316 cursor = db.cursor() 317 cursor.execute("SELECT sid " 318 "FROM session " 319 "WHERE authenticated=1") 316 320 users = ["*"] 317 data = perm.get_all_permissions()318 if not data:319 return [] # we abort here321 for username in cursor: 322 users.append(username) 323 return users 320 324 321 for (subject, action) in data:322 if subject not in users and subject not in ["anonymous", "authenticated"]:323 users.append(subject)324 return users325 326 325 def _get_candidate_subjects(self, not_in_list = []): 327 326 candidates = [] 328 327 users = [user for user in self._get_all_users()
comment:6 follow-up: 7 Changed 15 years ago by
my proposal:
-
svnauthz/
old new 310 310 311 311 def _get_all_users(self): 312 312 """ 313 Fetches all users/groups from PermissionSystem313 Fetches all users/groups 314 314 """ 315 perm = PermissionSystem(self.env)316 315 users = ["*"] 317 data = perm.get_all_permissions()316 data = self.env.get_known_users() 318 317 if not data: 319 318 return [] # we abort here 320 319 321 for (subject, action) in data:320 for (subject, name, email) in data: 322 321 if subject not in users and subject not in ["anonymous", "authenticated"]: 323 322 users.append(subject) 324 323 return users
comment:7 Changed 15 years ago by
I'm using the patch from comment 6. Works just fine and is really useful e.g. when using the account manager plugin and most users do not have special permissions. I'd vote for applying it (and please make a release to ease packaging).
comment:8 Changed 15 years ago by
I'm using the patch in comment 7 posted by till and it works perfectly. Makes more sense as well as there's no guarantee that a user will be in the session table.
comment:9 follow-up: 11 Changed 14 years ago by
comment:10 Changed 14 years ago by
Summary: | New users do not appear in members-list → [Patch] New users do not appear in members-list |
---|
comment:11 follow-up: 12 Changed 13 years ago by
Keywords: | user list added |
---|
Replying to rjollos:
Patch in comment:6 looks correct. Any objects by kisg that I commit this patch?
Anonymous in comment:8 seems reminds me of the temporary nature of the session
table (autopurge after some time of inactivity), while self.env.get_known_users()
will take information from session_attribute
table, that is guaranteed to last. Just my 2 ct.
comment:12 Changed 13 years ago by
Cc: | dmcr@… added; anonymous removed |
---|
Replying to hasienda:
Anonymous in comment:8 seems reminds me of the temporary nature of the
session
table (autopurge after some time of inactivity), whileself.env.get_known_users()
will take information fromsession_attribute
table, that is guaranteed to last. Just my 2 ct.
I went ahead and pushed the changes from Dennis in #8165 since kisg seems to have disappeared. I'm thinking we have enough positive feedback to apply this patch as well.
comment:13 Changed 11 years ago by
Owner: | changed from Kis Gergely to Ryan J Ollos |
---|---|
Status: | new → assigned |
comment:14 Changed 5 years ago by
Status: | assigned → new |
---|
The list of users that is shown comes from the list of users (or groups) in Trac that have been assigned at least one permission.
So, if you want to give one person specific access in svn authz, they need to have at least one permission explicitly granted to them in the Trac permissions; they can't have their only permissions come from Trac group membership.