Thursday, February 25, 2021

Contributors in Noi

We have a new volunteer contributor in Bangladesh. I fixed a series of little problems in Lino Noi.

Users of type lino_noi.lib.noi.UserTypes.contributor don’t want to see certain data, e.g. our contacts, or the tickets of teams where he is not member. Also e.g. the lino_xl.lib.groups.Groups table should be viewable only to the site administrator.

In lino_book.projects.noi1e, when signing in as mathieu (a contributor) you saw a welcome message that said you were working on ticket #1, but when clicking on the ticket it turned out that you had no permission to see that ticket. This was actually just because the demo fixture for lino_book.projects.noi1e created working.Session objects without checking whether the worker is a member of the team (given by the site of the ticket). I changed this demo fixture, which caused of course some doctests to fail because the ticket distribution has changed. And I adapted them.

The welcome messages of type “<worker> is working on <ticket>” (generated by lino_xl.lib.working.models.welcome_messages()) was always showing all workers. Which potentially caused link to a ticket that mathieu had no permission to see. But for a contributor it should show only sessions in teams the contributor belons to.

I removed the ContactsUser role from lino_noi.lib.noi.UserTypes.contributor.