On 7/12/21 8:25 AM, tibor.molnar@waltoninstitute.ie wrote:
Hi,
I would like to know if anyone have implemented this feature or used any workaround to be able to grant users with the ability to create list. This has been a feature in mailman2 where you as a user were able to create list with a password and you did not need to be a superuser in order to do that. I do understand that in the development documentation it states the following: Three of Django’s default User roles are relevant for Postorius:
Superuser: Can do everything. AnonymousUser: Can view list index and info pages. Authenticated users: Can view list index and info pages. Can (un)subscribe from lists.
Can we maybe add a different user role where the user would be able to create lists? If this is possible would anyone let me know how?
The user's role
is a Django thing. A user can be given either staff
or superuser
status or both or neither. As far as Django is concerned,
staff
status only allows the user to visit the Django administration
interface.
Currently, Postorius has decorators @list_owner_required, @list_moderator_required and @superuser_required defined in postorius/auth/decorators.py. There is also a @login_required decorator in django.contrib.auth.decorators. Postorius decorates the list_new() function in postorius/views/list.py with @login_required and @superuser_required.
It would be simple enough to create a new @staff_required decorator
which would require staff or superuser status and replace the
@superuser_required decorator on the list_new() function with
@staff_required. Then any user with staff
status could create lists.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan