oarepo_oaipmh_harvester.permissions
oarepo_oaipmh_harvester.permissions
Permission policies and generators for harvesters and harvest records.
- OAIHarvesterPermissionPolicy
- administrators manage harvesters; harvest managers
(HarvestManager, user ids in the
harvester's
harvest_managers) may read a harvester and run it. - OAIRecordPermissionPolicy
- harvest records are written by the system only; administrators and the managers of the record's harvester (HarvestRecordManager) may read them and re-harvest them.
Both manager generators also provide search query filters, so that managers only find their own harvesters / records.
HarvestManager
Bases: Generator
Grants harvest managers access to the harvesters they manage.
Source code in oarepo_oaipmh_harvester/permissions.py
needs(**kwargs: Any) -> Collection[Need]
Return the needs for harvest managers.
Source code in oarepo_oaipmh_harvester/permissions.py
query_filter(**kwargs: Any) -> dsl.query.Query | list[dsl.query.Query] | None
Restrict search to harvesters managed by the identity.
Source code in oarepo_oaipmh_harvester/permissions.py
OAIHarvesterPermissionPolicy
Bases: RecordPermissionPolicy
Permission policy for OAI Harvester records.
Source code in oarepo_oaipmh_harvester/permissions.py
HarvestRecordManager
Bases: Generator
Generator for giving access to harvested records for harvest record managers.
Source code in oarepo_oaipmh_harvester/permissions.py
needs(**kwargs: Any) -> Collection[Need]
Return the needs for harvest record managers.
Source code in oarepo_oaipmh_harvester/permissions.py
query_filter(**kwargs: Any) -> dsl.query.Query | list[dsl.query.Query] | None
Restrict search to records of harvesters managed by the identity.
Source code in oarepo_oaipmh_harvester/permissions.py
OAIRecordPermissionPolicy
Bases: RecordPermissionPolicy
Permission policy for harvested records.
Source code in oarepo_oaipmh_harvester/permissions.py
harvest_manager_need(manager: dict[str, Any]) -> Need
Return the need of a harvest manager entry ({"user": id}).
The user id is stored as a string, but the identity provides UserNeed with
an integer user id, so it is converted here to make the needs match.