Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
mod_bigbluebuttonbn\local\helpers\roles Class Reference

Utility class for all roles routines helper. More...

Static Public Member Functions

static get_participant_data (context $context, ?stdClass $bbactivity=null)
 Returns an array to populate a list of participants used in mod_form.js.
 
static get_participant_list (?stdClass $bigbluebuttonbn, context $context)
 Returns an array to populate a list of participants used in mod_form.php.
 
static get_participant_selection_data ()
 Returns an array to populate a list of participant_selection used in mod_form.php.
 
static get_roles (?context $context=null, ?bool $onlyviewableroles=true)
 Returns an array containing all the roles in a context.
 
static get_user_roles (context $context, int $userid)
 Returns user roles in a context.
 
static get_users_array (context_course $context, $bbactivity=null)
 Returns an array containing all the users in a context wrapped for html select element.
 
static has_capability_in_course (int $courseid, string $capability)
 Can do some administration in this course, likely manage recordings.
 
static import_get_courses_for_select (instance $instance)
 Helper function returns a list of courses a user has access to, wrapped in an array that can be used by a html select.
 
static is_moderator (context $context, array $participantlist, ?int $userid=null)
 Evaluate if a user in a context is moderator based on roles and participation rules.
 
static participant_joined (string $meetingid, bool $ismoderator)
 Updates the meeting info cached object when a participant has joined.
 

Public Attributes

string const ROLE_MODERATOR = 'moderator'
 The bigbluebutton moderator role.
 
int const ROLE_VIEWER = 'viewer'
 The bigbluebutton viewer role.
 

Static Protected Member Functions

static get_guest_role ()
 Returns guest role wrapped in an array.
 
static get_participant_list_default (context $context, ?int $ownerid=null)
 Returns an array to populate a list of participants used in mod_form.php with default values.
 
static get_participant_rules_encoded (array $rules)
 Returns an array to populate a list of participants used in mod_form.php with bigbluebuttonbn values.
 
static get_role ($id)
 Returns role that corresponds to an id.
 
static get_roles_select (context $context=null, bool $onlyviewableroles=true)
 Returns an array containing all the roles in a context wrapped for html select element.
 
static is_moderator_validate_rule (array $participant, int $userid, array $userroles)
 Evaluate if a user is moderator based on roles and a particular participation rule.
 
static is_moderator_validator (array $participantlist, int $userid, array $userroles)
 Iterates participant list rules to evaluate if a user is moderator.
 

Detailed Description

Utility class for all roles routines helper.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ get_guest_role()

static mod_bigbluebuttonbn\local\helpers\roles::get_guest_role ( )
staticprotected

Returns guest role wrapped in an array.

Return values
array

◆ get_participant_data()

static mod_bigbluebuttonbn\local\helpers\roles::get_participant_data ( context $context,
?stdClass $bbactivity = null )
static

Returns an array to populate a list of participants used in mod_form.js.

Parameters
context$context
null | stdClass$bbactivity
Return values
array\$data

◆ get_participant_list()

static mod_bigbluebuttonbn\local\helpers\roles::get_participant_list ( ?stdClass $bigbluebuttonbn,
context $context )
static

Returns an array to populate a list of participants used in mod_form.php.

Parameters
stdClass | null$bigbluebuttonbn
context$context
Return values
array

◆ get_participant_list_default()

static mod_bigbluebuttonbn\local\helpers\roles::get_participant_list_default ( context $context,
?int $ownerid = null )
staticprotected

Returns an array to populate a list of participants used in mod_form.php with default values.

Parameters
context$context
int | null$ownerid
Return values
array

◆ get_participant_rules_encoded()

static mod_bigbluebuttonbn\local\helpers\roles::get_participant_rules_encoded ( array $rules)
staticprotected

Returns an array to populate a list of participants used in mod_form.php with bigbluebuttonbn values.

Parameters
array$rules
Return values
array

◆ get_participant_selection_data()

static mod_bigbluebuttonbn\local\helpers\roles::get_participant_selection_data ( )
static

Returns an array to populate a list of participant_selection used in mod_form.php.

Return values
array

◆ get_role()

static mod_bigbluebuttonbn\local\helpers\roles::get_role ( $id)
staticprotected

Returns role that corresponds to an id.

Parameters
string | integer$id
Return values
stdClass|null\$role

◆ get_roles()

static mod_bigbluebuttonbn\local\helpers\roles::get_roles ( ?context $context = null,
?bool $onlyviewableroles = true )
static

Returns an array containing all the roles in a context.

Parameters
context | null$context$context
bool | null$onlyviewableroles
Return values
array\$roles

◆ get_roles_select()

static mod_bigbluebuttonbn\local\helpers\roles::get_roles_select ( context $context = null,
bool $onlyviewableroles = true )
staticprotected

Returns an array containing all the roles in a context wrapped for html select element.

Parameters
context | null$context$context
bool$onlyviewableroles
Return values
array\$users

◆ get_user_roles()

static mod_bigbluebuttonbn\local\helpers\roles::get_user_roles ( context $context,
int $userid )
static

Returns user roles in a context.

Parameters
context$context
int$userid
Return values
array\$userroles

◆ get_users_array()

static mod_bigbluebuttonbn\local\helpers\roles::get_users_array ( context_course $context,
$bbactivity = null )
static

Returns an array containing all the users in a context wrapped for html select element.

Parameters
context_course$context
null$bbactivity
Return values
array\$users

◆ has_capability_in_course()

static mod_bigbluebuttonbn\local\helpers\roles::has_capability_in_course ( int $courseid,
string $capability )
static

Can do some administration in this course, likely manage recordings.

Parameters
int$courseid
string$capability

◆ import_get_courses_for_select()

static mod_bigbluebuttonbn\local\helpers\roles::import_get_courses_for_select ( instance $instance)
static

Helper function returns a list of courses a user has access to, wrapped in an array that can be used by a html select.

Parameters
instance$instance
Return values
array

◆ is_moderator()

static mod_bigbluebuttonbn\local\helpers\roles::is_moderator ( context $context,
array $participantlist,
?int $userid = null )
static

Evaluate if a user in a context is moderator based on roles and participation rules.

Parameters
context$context
array$participantlist
int$userid
Return values
bool

◆ is_moderator_validate_rule()

static mod_bigbluebuttonbn\local\helpers\roles::is_moderator_validate_rule ( array $participant,
int $userid,
array $userroles )
staticprotected

Evaluate if a user is moderator based on roles and a particular participation rule.

Parameters
array$participant
int$userid
array$userroles
Return values
bool

◆ is_moderator_validator()

static mod_bigbluebuttonbn\local\helpers\roles::is_moderator_validator ( array $participantlist,
int $userid,
array $userroles )
staticprotected

Iterates participant list rules to evaluate if a user is moderator.

Parameters
array$participantlist
int$userid
array$userroles
Return values
bool

◆ participant_joined()

static mod_bigbluebuttonbn\local\helpers\roles::participant_joined ( string $meetingid,
bool $ismoderator )
static

Updates the meeting info cached object when a participant has joined.

Parameters
string$meetingid
bool$ismoderator
Return values
void

The documentation for this class was generated from the following file: