tbar0970 / jethro-pmm

Jethro Pastoral Ministry Manager
GNU General Public License v3.0
35 stars 25 forks source link

Restricted Jethro accounts should not be able to view 'no congregation' persons #877

Closed jefft closed 1 year ago

jefft commented 1 year ago

Jethro allows accounts to be restricted in which persons they can view. For instance, this user should only be able to see members of the 'Musicians' group. They should not be able to see members of 9am and 5pm congregations:

image

However, what about persons not in any congregation, like visitors or members of youth groups?

I would have expected they would be invisible, but Jethro with the settings above shows them.

Demo

Attached (jethro_demosystem.sql.gz) is a sample Jethro database, containing Ben Churchgoer who attends 5pm, and his daughter Claire who is in no congregation but is member of 'Youth Group':

image

The bandviewer account is restricted to 'Musicians' as above, but can see not only the legitimate 'Musicians' members, but Claire too: image

(password for demo and bandviewer accounts is demo123123)

jefft commented 1 year ago

Suggested fix:

tbar0970 commented 1 year ago

I don't think we need to change the interface. Your assumption about the original case was correct. I'll investigate why the congregationless person was incorrectly showing up.

jefft commented 1 year ago

Well, say someone does actually want, say, "5pm plus congregationless visitors". Right now they just check "5pm".

If you fix the bug, and suddenly the congregationless people disappear, how do they get the original behaviour back? That's where we'd need a 'no congregation' checkbox.

tbar0970 commented 1 year ago

Ability to see "5pm plus congregationless contacts" would be a new feature, which somebody could request if they needed it :) Meanwhile there's an actual bug to fix first!

tbar0970 commented 1 year ago

Oh right, I see what you mean - people might be relying on the current (erroneous) behaviour. But I doubt it. The explanatory text is pretty clear.

tbar0970 commented 1 year ago

Diagnosis: Since https://github.com/tbar0970/jethro-pmm/commit/3e07f47b906c838b93b9d0abd7fa521873efcbc0#diff-0f35e6e15927e7239b1b988169fa734e54756c1174359534dbb3c188cc78a6b1R224 the person view definition erroneously looked for a congregationid column in the account_group_restriction table. Mysql treated this as a reference to person.congregationid, which introduced entirely wrong logic.