-
Notifications
You must be signed in to change notification settings - Fork 18
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 config to lock video ACLs to their series #1305
base: next
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
3d53a9f
to
119ad94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it and it works very well, no problems found there!
I found a few minor code things, but unfortunately also a bigger one (due to a n+1 query problem). That will require a bit of frontend change as well, but shouldn't be too terrible.
119ad94
to
b0490c8
Compare
const SeriesAclQuery = graphql` | ||
query UploadSeriesAclQuery($seriesId: String!) { | ||
series: seriesByOpencastId(id: $seriesId) { | ||
acl { role actions info { label implies large } } | ||
} | ||
} | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why by Opencast ID? 🤔 We do have the normal ID (maybe it has the wrong prefix, but thats easily fixed), no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm we need the opencast ID anyway for the ingest, so I didn't think it necessary to also pass the regular id around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah I guess it doesn't really matter
const data = await fetchQuery<UploadSeriesAclQuery>( | ||
environment, | ||
SeriesAclQuery, | ||
{ seriesId } | ||
).toPromise(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think useQueryLoader
is more idiomatic here? :/ But mhhh not sure if it's worth it changing that. It would also change the UX a bit: the ACL UI would be completely hidden while loading instead of showing the old value. Not sure if thats better or worse. So yeah no hard opinion, we can probably just keep it...
frontend/src/routes/Upload.tsx
Outdated
|
||
if (!data?.opencastId) { | ||
setLockedAcl(null); | ||
resetField("acl"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to reset it in this situation? I would be fine if the ACL that were previously configured would re-eappear when the series is cleared. Not sure whats more useful...
Edit: oh especially when CONFIG.lockAclToSeries
is not set, then this means that my configured ACLs (which I was able to edit with a series selected) get discarded when I clear the series, right?
This pull request has conflicts ☹ |
With this enabled, event ACLs can't be edited and will generally be determined by their series.
b0490c8
to
34f9159
Compare
And then also disable ACL editing and attachment. In a previous iteration, this was using a suboptimal approach where each series returned by the API would send an additional query to get the series ACL. Now this only sends a single additional query whenever a series is actually selected. While this requires more code, a good amount of it is just state management and error handling/reporting. The rest is related to the data fetching.
34f9159
to
b3a10b3
Compare
This will disable ACL editing for the uploader and the ACL UI when the video is part of a series.
Uploaded videos will then adopt the ACL of that series.
This needs to be configured with
lock_acl_to_series
, the default for this isfalse
.Closes #1006