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

Remove remaining course acls from video #1061

Open
dennis531 opened this issue Nov 11, 2024 · 0 comments · May be fixed by #1068
Open

Remove remaining course acls from video #1061

dennis531 opened this issue Nov 11, 2024 · 0 comments · May be fixed by #1068
Assignees
Labels

Comments

@dennis531
Copy link
Collaborator

dennis531 commented Nov 11, 2024

Version
master branch

Describe the bug
The course ACLs of a video will never be removed, as they will be handled like other external OC roles in

public static function filterACLs($acls, $studip_acls)
{
if (!is_array($acls)) {
return [
'studip' => [],
'other' => []
];
}
// prevent duplicate ACLs
$temp_acls = [];
foreach ($acls as $acl) {
$temp_acls[$acl['allow'] .'#'. $acl['role'] . $acl['action']] = $acl;
}
$acls = array_values($temp_acls);
$possible_roles = array_column($studip_acls, 'role');
sort($acls);
$result = [];
foreach ($acls as $entry) {
if (in_array($entry['role'], $possible_roles) !== false) {
$result[$entry['role'] .'_'. $entry['action']] = $entry;
}
}
$result = array_values($result);
sort($result);
$diff = array_udiff($acls, $result, ['Opencast\Models\Helpers', 'compareACLs']);
return [
'studip' => $result,
'other' => $diff
];
}

I had noticed this when fixing #1031.

To Reproduce
Steps to reproduce the behavior:

  1. Remove video from course
  2. Change "Weltweiter Zugriff" to trigger the updateAcl function
  3. Check ACls in Opencast for this video
  4. See ACLs of course are still there
@dennis531 dennis531 self-assigned this Nov 12, 2024
@dennis531 dennis531 linked a pull request Nov 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant