Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Tracks all the contexts related to the one where we are currently editing questions, and provides helper methods to check permissions. More...
Public Member Functions | |
__construct (context $thiscontext) | |
Constructor. More... | |
all () | |
have_cap ($cap) | |
Has at least one parent context got the cap $cap? More... | |
have_one_cap ($caps) | |
Has at least one parent context got one of the caps $caps? More... | |
have_one_edit_tab_cap ($tabname) | |
Has at least one parent context got one of the caps for actions on $tabname. More... | |
having_add_and_use () | |
having_cap ($cap) | |
having_one_cap ($caps) | |
having_one_edit_tab_cap ($tabname) | |
lowest () | |
require_cap ($cap) | |
Throw error if at least one parent context hasn't got the cap $cap. More... | |
require_one_cap ($caps) | |
Throw error if at least one parent context hasn't got one of the caps $caps. More... | |
require_one_edit_tab_cap ($tabname) | |
Throw error if at least one parent context hasn't got one of the caps $caps. More... | |
Static Public Attributes | |
static | $caps |
Protected Attributes | |
$allcontexts | |
Tracks all the contexts related to the one where we are currently editing questions, and provides helper methods to check permissions.
question_edit_contexts::__construct | ( | context | $thiscontext | ) |
Constructor.
context | the current context. |
question_edit_contexts::all | ( | ) |
context[] | all parent contexts |
question_edit_contexts::have_cap | ( | $cap | ) |
Has at least one parent context got the cap $cap?
string | $cap | capability |
boolean |
question_edit_contexts::have_one_cap | ( | $caps | ) |
Has at least one parent context got one of the caps $caps?
array | $caps | capability |
boolean |
question_edit_contexts::have_one_edit_tab_cap | ( | $tabname | ) |
Has at least one parent context got one of the caps for actions on $tabname.
string | $tabname | edit tab name |
boolean |
question_edit_contexts::having_add_and_use | ( | ) |
context[] | those contexts where a user can add a question and then use it. |
question_edit_contexts::having_cap | ( | $cap | ) |
string | $cap | capability |
context[] | parent contexts having capability, zero based index |
question_edit_contexts::having_one_cap | ( | $caps | ) |
array | $caps | capabilities |
context[] | parent contexts having at least one of $caps, zero based index |
question_edit_contexts::having_one_edit_tab_cap | ( | $tabname | ) |
string | $tabname | edit tab name |
context[] | parent contexts having at least one of $caps, zero based index |
question_edit_contexts::lowest | ( | ) |
context | lowest context which must be either the module or course context |
question_edit_contexts::require_cap | ( | $cap | ) |
Throw error if at least one parent context hasn't got the cap $cap.
string | $cap | capability |
question_edit_contexts::require_one_cap | ( | $caps | ) |
Throw error if at least one parent context hasn't got one of the caps $caps.
array | $caps | capabilities |
question_edit_contexts::require_one_edit_tab_cap | ( | $tabname | ) |
Throw error if at least one parent context hasn't got one of the caps $caps.
string | $tabname | edit tab name |
|
static |