Added a new argument to the methods: get_permanent_acl_rules_for_status and get_acl_rules_for_status called $forceonhidden which is a flag to return the permanent roles even if the visibility is hidden.
The reason to add new argument is to maintain the original concept and to not touch any old behavior.
if that flag is true then in get_acl_rules_for_status in case of hidden we check first if it is permanent and it is forced to return roles, then we prepare the roles and pass it back as the result.
How to TEST this PR.
Make sure you are using duplicate event mode for import videos.
Try to import a mixture of hidden and visible videos in a course to a new one, either by Manual import or Course (bulk) Import wizard.
Make sure the cronjob is working.
You would need to wait for both process_duplicate_event and ultimately process_duplicated_event_visibility_change adhoc tasks to be performed.
That means it takes some times for moodle to perform the duplicate event and then when the workflow in opencast is finished the visibility change will take place (so wait until both are done)
At the end you should confirm that the imported videos (duplicated) have the same original visibility status (except group) in the new course. (hidden->hidden) (visible->visible) (group->hidden)
This PR fixes #371
Description
Please refer to the issue's description and comments. https://github.com/Opencast-Moodle/moodle-block_opencast/issues/371#issuecomment-2020047954
Solution
get_permanent_acl_rules_for_status
andget_acl_rules_for_status
called$forceonhidden
which is a flag to return the permanent roles even if the visibility is hidden.get_acl_rules_for_status
in case of hidden we check first if it is permanent and it is forced to return roles, then we prepare the roles and pass it back as the result.How to TEST this PR.
process_duplicate_event
and ultimatelyprocess_duplicated_event_visibility_change
adhoc tasks to be performed.