[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/availability/classes/ -> capability_checker.php (summary)

Used while evaluating conditions in bulk. This object caches get_users_by_capability results in case they are needed by multiple conditions.

Copyright: 2014 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 77 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

capability_checker:: (2 methods):
  __construct()
  get_users_by_capability()


Class: capability_checker  - X-Ref

Used while evaluating conditions in bulk.

This object caches get_users_by_capability results in case they are needed
by multiple conditions.

__construct(\context $context)   X-Ref
Constructs for given context.

param: \context $context Context

get_users_by_capability($capability)   X-Ref
Gets users on course who have the specified capability. Returns an array
of user objects which only contain the 'id' field. If the same capability
has already been checked (e.g. by another condition) then a cached
result will be used.

More fields are not necessary because this code is only used to filter
users from an existing list.

param: string $capability Required capability
return: array Associative array of user id => objects containing only id



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1