Modify

Opened 6 years ago

Last modified 4 years ago

#5010 new enhancement

Force users to join/pre-join groups?

Reported by: anonymous Owned by: doki_pen
Priority: low Component: AnnouncerPlugin
Severity: minor Keywords:
Cc: Trac Release: 0.11

Description

Is there a way to force users to automatically join or pre-add them into a group?

I'm trying to set up a local trac but having to log in and out of each account to subscribe to the appropriate groups is annoying.

Attachments (0)

Change History (7)

comment:1 Changed 6 years ago by anonymous

  • Type changed from defect to task

comment:2 Changed 6 years ago by anonymous

There is currently no functionality for this. You could write a python script, or make an admin panel to list users and add them to groups. None of the following code is tested. The python for insertion would be:

insert into session_attribute (sid, authenticated, name, value) values('$user', 1, 'announcer_joinable_group_@$group', 1);

If the row already exists, then it needs to be updated instead:

update session_attribute set value = 1 where name = 'announcer_joinable_group_@$group' and sid = '$user';

It can be done with the session in trac(much easier):

from trac.env import Environment
from trac.web.session import DetachedSession

env = Environment('$path2env')
for user in ('user1', 'user2', 'user3'):
  sess = DetachedSession(env, user)
  sess['announcer_joinable_group_@$group'] = 1
  sess.save()

If you do this within a plugin, you won't need to create the env. I will accept an admin panel for this functionality.

comment:3 Changed 6 years ago by anonymous

I wish there was edit :( The first two examples are obviously sql and not python.

comment:4 Changed 6 years ago by anonymous

Thanks. The SQL works.

I wish I could add an admin panel but I'm seriously not up to the task (although I'll probably try, fail and hide in shame).

comment:5 Changed 5 years ago by rjollos

This is similar to an enhancement request I posted in #5572, assuming you want to specify defaults that would apply to all users at the time their accounts are created.

comment:6 Changed 5 years ago by rjollos

  • Type changed from task to enhancement

comment:7 Changed 4 years ago by doki_pen

  • Priority changed from normal to low
  • Severity changed from normal to minor

Add Comment

Modify Ticket

Action
as new The owner will remain doki_pen.
Author


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

 
Note: See TracTickets for help on using tickets.