Skip to content

Commit

Permalink
Add episode id roles to user provider
Browse files Browse the repository at this point in the history
These roles are supported from Opencast version 17. See details in https://docs.opencast.org/r/17.x/admin/#configuration/episode-id-roles/#episode-id-roles.
  • Loading branch information
dennis531 committed Jan 10, 2025
1 parent facfc0b commit 5756211
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Routes/Opencast/UserRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function __invoke(Request $request, Response $response, $args)
$video_share = VideosShares::findByUuid($share_uuid);
if (!empty($video_share)) {
$roles[] = $video_share->video->episode . '_read';
$roles[] = 'ROLE_EPISODE_' . $video_share->video->episode . '_READ';
} else {
throw new Error('Share not found', 404);
}
Expand Down Expand Up @@ -95,8 +96,11 @@ public function __invoke(Request $request, Response $response, $args)

if ($vperm->perm == 'owner' || $vperm->perm == 'write') {
$roles[$vperm->video->episode . '_write'] = $vperm->video->episode . '_write';
$roles['ROLE_EPISODE_' . $vperm->video->episode . '_READ'] = 'ROLE_EPISODE_' . $vperm->video->episode . '_READ';
$roles['ROLE_EPISODE_' . $vperm->video->episode . '_WRITE'] = 'ROLE_EPISODE_' . $vperm->video->episode . '_WRITE';
} else {
$roles[$vperm->video->episode . '_read'] = $vperm->video->episode . '_read';
$roles['ROLE_EPISODE_' . $vperm->video->episode . '_READ'] = 'ROLE_EPISODE_' . $vperm->video->episode . '_READ';
}
}

Expand All @@ -110,6 +114,7 @@ public function __invoke(Request $request, Response $response, $args)

while($episode = $stmt_courseware->fetchColumn()) {
$roles[$episode . '_read'] = $episode . '_read';
$roles['ROLE_EPISODE_' . $episode . '_READ'] = 'ROLE_EPISODE_' . $episode . '_READ';
}

$stmt_courses = \DBManager::get()->prepare("SELECT seminar_id FROM seminar_user
Expand Down

0 comments on commit 5756211

Please sign in to comment.