Skip to content

Conversation

@max-moser
Copy link
Contributor

@max-moser
Copy link
Contributor Author

I haven't added any tests here because the write operations for users and groups per API aren't implemented yet.

"""Permission policy for users and user groups."""

can_create = [SystemProcess()]
can_create = [SystemProcess(), DisableIfReadOnly()]
Copy link
Contributor

Choose a reason for hiding this comment

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

could you describe what does it solve ? not sure I understand the use case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The primary use case for the read-only mode is to make it easier for migrating InvenioRDM instances to new VMs without losing write operations.
We already have a slightly simpler version of this hacked into our own TUW modules.

For example, for us it came in handy when we were migrating our instance from the test environment VM to the production VM:
We set the old instance in RO mode, cloned it to the new VM (DB & files), and started running the new instance (not in RO mode).
After that, we just needed to change the DNS entry to point to the new VM rather than the old one, and we were done.

Given that write operations were prohibited in RO mode, we are very certain that there were no lost writes during the migration.
Unfortunately, this is only true for write operations that go through a service layer with these PRs and doesn't cover e.g. user profile edits.

@fenekku
Copy link
Contributor

fenekku commented Mar 10, 2023

Coordination:

Moving this to To Review and adding same people (@utnapischtim , @ppanero and @ntarocco . If someone else would be better suited to look at it, let us know!) as other related PR to help unblock things

@ntarocco
Copy link
Contributor

I guess you will require something similar also in communities, requests, rdm-records, draft-resources, etc.. :)

@utnapischtim
Copy link
Contributor

@utnapischtim
Copy link
Contributor

closed, because of not more necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: Released | Done 🚀

Development

Successfully merging this pull request may close these issues.

6 participants