-
Notifications
You must be signed in to change notification settings - Fork 502
Plugin: Add config-based control for global conference roles visibility in BBB - refs #3498 #6336
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,6 +159,42 @@ public static function updateCourseFieldInAllCourses(string $variable, string $v | |
$entityManager->flush(); | ||
} | ||
|
||
public function canCurrentUserSeeGlobalConferenceLink(): bool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function |
||
{ | ||
$allowedStatuses = $this->get('global_conference_allow_roles') ?? []; | ||
|
||
if (empty($allowedStatuses)) { | ||
return api_is_platform_admin(); | ||
} | ||
|
||
foreach ($allowedStatuses as $status) { | ||
switch ((int) $status) { | ||
case PLATFORM_ADMIN: | ||
if (api_is_platform_admin()) { | ||
return true; | ||
} | ||
break; | ||
case COURSEMANAGER: | ||
if (api_is_teacher()) { | ||
return true; | ||
} | ||
break; | ||
case STUDENT: | ||
if (api_is_student()) { | ||
return true; | ||
} | ||
break; | ||
case STUDENT_BOSS: | ||
if (api_is_student_boss()) { | ||
return true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid too many |
||
} | ||
break; | ||
} | ||
} | ||
|
||
return false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid too many |
||
} | ||
|
||
public function get_name(): string | ||
{ | ||
return 'Bbb'; | ||
|
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.
Method
canCurrentUserSeeGlobalConferenceLink
has 29 lines of code (exceeds 25 allowed). Consider refactoring.