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

Add migration for custom ACL actions #1164

Merged
merged 1 commit into from May 16, 2024

Conversation

owi92
Copy link
Member

@owi92 owi92 commented May 7, 2024

Custom actions for events are now stored in DB with a new column. This is only the backend side of things, so they won't show up in the ACL UI yet.

Part of #1004

@owi92 owi92 added the changelog:dev Changes primarily for developers label May 7, 2024
@github-actions github-actions bot temporarily deployed to test-deployment-pr1164 May 7, 2024 08:33 Destroyed
Copy link
Member

@LukasKalbertodt LukasKalbertodt left a comment

Choose a reason for hiding this comment

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

Looks good overall.

I think using jsonb as DB storage is fine. It is unlikely that we ever need to filter by these values in a DB query: from the DB perspective it's one atomic value. And even if requirements change, PostgreSQL can apparently index jsonb fields somehow, or at worst case we have to change the DB schema, but that's all possible. So going with the most straight forward way seems like a good idea.

Apart from a few minor remarks below, generally this PR could use some more comments. A short doc comment on CustomActions struct explaining what the hash map represents (mapping action to list of roles). Same at top of the DB migration. And maybe a comment for check_custom_actions_format. None of those need to be long, but yeah, neither jsonb nor HashMap<String, Vec<String>> make it immediately clear what data to expect how.

backend/src/sync/harvest/response.rs Outdated Show resolved Hide resolved
backend/src/sync/harvest/response.rs Outdated Show resolved Hide resolved
backend/src/db/migrations/32-custom-actions.sql Outdated Show resolved Hide resolved
backend/src/db/migrations/32-custom-actions.sql Outdated Show resolved Hide resolved
Custom actions are now stored in DB with a new column.
This is only the backend side of things, so they won't
show up in the ACL UI yet.
@owi92 owi92 force-pushed the custom-actions-migration branch from c81f8c4 to 6d176ce Compare May 16, 2024 09:49
@owi92
Copy link
Member Author

owi92 commented May 16, 2024

Thanks for the review. Here's a little screenshot of an event with custom actions in the db, since I don't expect you to test this (would require a bit of tinkering in your local Opencast):
Bildschirmfoto 2024-05-16 um 11 49 09

(Should have included that in the first place)

@github-actions github-actions bot temporarily deployed to test-deployment-pr1164 May 16, 2024 09:55 Destroyed
@LukasKalbertodt LukasKalbertodt merged commit 0686824 into elan-ev:master May 16, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:dev Changes primarily for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants