◆ check_capability()
static tool_uploadcourse\permissions::check_capability |
( |
int | $do, |
|
|
array | $coursedata, |
|
|
string | $capability ) |
|
staticprotected |
Check capability in a course (that exists or is about to be created).
- Parameters
-
int | $do | one of tool_uploadcourse_course\DO_UPDATE or tool_uploadcourse_course\DO_ADD |
array | $coursedata | data to update/create course with, must contain either 'id' or 'category' respectively |
string | $capability | capability to check |
- Return values
-
lang_string|null | error string or null |
◆ check_permission_to_create()
static tool_uploadcourse\permissions::check_permission_to_create |
( |
array | $coursedata | ) |
|
|
static |
Check permission to create course.
This checks capabilities:
- to use tool_uploadcourse in the category where course will be created.
- to create a course.
- to force course language (if applicable).
- to set course tags (if applicable).
- Parameters
-
array | $coursedata | data to create a course with, always contains 'category' |
- Return values
-
◆ check_permission_to_delete()
static tool_uploadcourse\permissions::check_permission_to_delete |
( |
string | $shortname | ) |
|
|
static |
Check capabilities to delete a course and to use tool_uploadcourse for it.
- Parameters
-
string | $shortname | course shortname |
- Return values
-
◆ check_permission_to_reset()
static tool_uploadcourse\permissions::check_permission_to_reset |
( |
array | $coursedata | ) |
|
|
static |
Check if the user is able to reset a course.
Capability to use the tool and update the course is already checked earlier.
- Parameters
-
array | $coursedata | data to update course with, always contains 'id' |
- Return values
-
lang_string|null | error string or null |
◆ check_permission_to_restore()
static tool_uploadcourse\permissions::check_permission_to_restore |
( |
int | $do, |
|
|
array | $coursedata ) |
|
static |
Check if the user is able to restore the mbz into a course.
This method does not need to check if the course can be updated/created, this is checked earlier.
- Parameters
-
int | $do | one of tool_uploadcourse_course\DO_UPDATE or tool_uploadcourse_course\DO_ADD |
array | $coursedata | data to update/create course with, must contain either 'id' or 'category' respectively |
- Return values
-
lang_string|null | error string or null |
◆ check_permission_to_update()
static tool_uploadcourse\permissions::check_permission_to_update |
( |
array | $coursedata | ) |
|
|
static |
Check permission to update the course.
This checks capabilities:
- to use tool_uploadcourse in the category where course is in and in the category where it will be moved to (if applicable).
- to change course category (if applicable).
- to update course details.
- to force course language (if applicable).
- to change course idnumber, shortname, fullname, summary, visibility, tags (if applicable).
- Parameters
-
array | $coursedata | data to update a course with, always contains 'id' |
- Return values
-
◆ check_permission_to_use_uploadcourse_tool()
static tool_uploadcourse\permissions::check_permission_to_use_uploadcourse_tool |
( |
int | $catid, |
|
|
?lang_string | $customerror = null ) |
|
staticprotected |
Check permission to use tool_uploadcourse in a given category.
- Parameters
-
- Return values
-
The documentation for this class was generated from the following file:
- admin/tool/uploadcourse/classes/permissions.php