Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 402] [Versions 400 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.

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

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.

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

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.

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

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.

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

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

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

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

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

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

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

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.

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

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.

return: array
param: array $rules

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.

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

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

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

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.

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

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

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

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.

return: array
param: instance $instance