Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 and 403]

The mod_bigbluebuttonbn roles helper

Author: Laurent David (laurent [at] call-learning [dt] fr)
Copyright: 2021 onwards, Blindside Networks Inc
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 452 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: roles  - X-Ref

Utility class for all roles routines helper

get_user_roles(context $context, int $userid)   X-Ref
Returns user roles in a context.

param: context $context
param: int $userid
return: array $userroles

get_guest_role()   X-Ref
Returns guest role wrapped in an array.

return: array

get_users_array(context_course $context, $bbactivity = null)   X-Ref
Returns an array containing all the users in a context wrapped for html select element.

param: context_course $context
param: null $bbactivity
return: array $users

has_capability_in_course(int $courseid, string $capability)   X-Ref
No description

get_roles(?context $context = null, ?bool $onlyviewableroles = true)   X-Ref
Returns an array containing all the roles in a context.

param: context|null $context $context
param: bool|null $onlyviewableroles
return: array $roles

get_roles_select(context $context = null, bool $onlyviewableroles = true)   X-Ref
Returns an array containing all the roles in a context wrapped for html select element.

param: context|null $context $context
param: bool $onlyviewableroles
return: array $users

get_role($id)   X-Ref
Returns role that corresponds to an id.

param: string|integer $id
return: stdClass|null $role

get_participant_data(context $context, ?stdClass $bbactivity = null)   X-Ref
Returns an array to populate a list of participants used in mod_form.js.

param: context $context
param: null|stdClass $bbactivity
return: array $data

get_participant_list(?stdClass $bigbluebuttonbn, context $context)   X-Ref
Returns an array to populate a list of participants used in mod_form.php.

param: stdClass|null $bigbluebuttonbn
param: context $context
return: array

get_participant_list_default(context $context, ?int $ownerid = null)   X-Ref
Returns an array to populate a list of participants used in mod_form.php with default values.

param: context $context
param: int|null $ownerid
return: array

get_participant_rules_encoded(array $rules)   X-Ref
Returns an array to populate a list of participants used in mod_form.php with bigbluebuttonbn values.

param: array $rules
return: array

get_participant_selection_data()   X-Ref
Returns an array to populate a list of participant_selection used in mod_form.php.

return: array

is_moderator(context $context, array $participantlist, ?int $userid = null)   X-Ref
Evaluate if a user in a context is moderator based on roles and participation rules.

param: context $context
param: array $participantlist
param: int $userid
return: bool

is_moderator_validator(array $participantlist, int $userid, array $userroles)   X-Ref
Iterates participant list rules to evaluate if a user is moderator.

param: array $participantlist
param: int $userid
param: array $userroles
return: bool

is_moderator_validate_rule(array $participant, int $userid, array $userroles)   X-Ref
Evaluate if a user is moderator based on roles and a particular participation rule.

param: array $participant
param: int $userid
param: array $userroles
return: bool

participant_joined(string $meetingid, bool $ismoderator)   X-Ref
Updates the meeting info cached object when a participant has joined.

param: string $meetingid
param: bool $ismoderator
return: void

import_get_courses_for_select(instance $instance)   X-Ref
Helper function returns a list of courses a user has access to, wrapped in an array that can be used
by a html select.

param: instance $instance
return: array