Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIMPLYE-261 - Municipality and consortium management #30

Merged
merged 5 commits into from
Apr 5, 2024

Conversation

attemoi
Copy link
Contributor

@attemoi attemoi commented Apr 2, 2024

Description

Goal

  • Possibility to customize lanes for each Kimppa (aka consortium)
  • All Kimppas share the same collections, i.e.:
    -> License pools shared between all Kimppas
    -> All patrons will have access to the same works regardless of Kimppa
  • Easy handling for municipality and Kimppa data and mapping. Mapping done based on municipality code received during sign in.

Available data

  1. Municipality code for patron and admin during authentication
  2. Two 3rd party APIs:

Solution

  • One library per Kimppa (+ default library) configured in circulation
    • Each library configured with list of member municipalities
  • Patrons and admins automatically assigned to library during sign in
  • Unauthenticated users will see the default library lanes
  • Collections defined for default library apply to all other libraries
  • New monitor script (ekirjasto_consortium_monitor) to automatically keep libraries (i.e. Kimppas) synced with Kirkanta data

Other notes

  • No database changes needed
  • No changes to authorization logic for list/lane management
  • Some municipalities don't belong to a Kimppa
  • Users with "turvakielto" have municipality code 000, i.e. they won't belong to any Kimppa

Motivation and Context

https://docs.google.com/document/d/1oq9_YBgfY5JMh_zDROZyDHts5FZfH_PQ1FRz1IVxv-k/edit#heading=h.y5cwsxdy2zq5

https://jira.lingsoft.fi/browse/SIMPLYE-261 - Prepare the data foundation to handle municipality and library patron info
https://jira.lingsoft.fi/browse/SIMPLYE-262 - Implement the mapping between municipalities and libraries
https://jira.lingsoft.fi/browse/SIMPLYE-263 - Implement custom lane management for local librarians

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@attemoi attemoi force-pushed the feature/simplye-261/municipality-info branch 4 times, most recently from 1f0bd6a to 5a41973 Compare April 3, 2024 10:24
Assign each patron and admin to a library based on the municipality code
received during authentication.
@attemoi attemoi force-pushed the feature/simplye-261/municipality-info branch from 2d9082f to 16747bb Compare April 4, 2024 09:01
@@ -94,7 +96,9 @@ def ekirjasto_auth_finish(self):
if isinstance(user_info, ProblemDetail):
return user_info

circulation_role = self._to_circulation_role(user_info.role)
circulation_role = self._to_circulation_role(
self._db, user_info.role, user_info.municipality
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is still pending some discussion/decisions on how the two municipality fields (municipality and municipalities) we get during authentication (with user info) will be managed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now handled. The singular municipality field will be used for patrons and municipalities field for admins and librarians to determine which libraries they can manage.

@attemoi attemoi force-pushed the feature/simplye-261/municipality-info branch 2 times, most recently from 154b065 to 74dd78c Compare April 4, 2024 09:50
attemoi added 4 commits April 4, 2024 12:51
Add new option under library settings that allows syncing library
data automatically from Kirkanta and Kansallinen koodistopalvelu.
it's not super clear currently in the admin UI that collections
defined for default library are applied to all other libraries.

By passing this extra field we can then display some extra info
on the admin UI side.
The user info from authentication has two fields, `municipality` and
`municipalities`. The first is used to link patrons to a consortium,
and second one is used for admins and librarians to determine which
libraries they can manage.
@attemoi attemoi marked this pull request as ready for review April 5, 2024 06:57
@sylvain-degeilh-lingsoft
Copy link
Contributor

Some updated information:

  • Municipalities without a kimppa should be set into their own 1-municipality kimppa.
  • Patrons with turvakielto should not get access to the service at the moment. Loikka is expected to handle that aspect, as well as patrons from municipalities not taking part in the E-kirjasto service.

@attemoi
Copy link
Contributor Author

attemoi commented Apr 5, 2024

@sylvain-degeilh-lingsoft, thanks for the update!

Municipalities without a Kimppa should be set into their own 1-municipality kimppa.

This one is already supported, as we can manage a library for those municipalities manually, without automatic sync. If needed, can be automated further with a separate PR.

@attemoi attemoi merged commit 8620647 into main Apr 5, 2024
24 checks passed
@attemoi attemoi deleted the feature/simplye-261/municipality-info branch April 5, 2024 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants