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

config: make service configs configurable #399

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mirekys
Copy link

@mirekys mirekys commented Feb 11, 2022

This enables users of the module to override default configs of the provided services.

One could implement & provide their own ServiceConfig class inheriting from CommunityServiceConfig,
and e.g. customize PermissionPolicies, record links, add fields to Community records through
extending record schema, etc.

Copy link
Member

@lnielsen lnielsen left a comment

Choose a reason for hiding this comment

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

First of all, thanks for the contribution and apologies I didn't see this earlier.

We're trying to avoid the pattern used here as it opens up too large an API that we're likely not going to be able to keep stable, and often the configs might be interconnected making it hard for users of InvenioRDM to change it.

Please see the example here:
https://inveniordm.docs.cern.ch/develop/topics/service/#instantiating-a-service

service = ClickService(ClickServiceConfig.build(current_app))
service.click(system_identity)

You'll find the pattern implemented in Invenio-RDM-Records - e.g. https://github.com/inveniosoftware/invenio-rdm-records/blob/master/invenio_rdm_records/services/config.py#L99-L102

Which specific items do you want to configure? Just permissions?

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