mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-51645 tool_lp: Rename the plan capabilities
This commit is contained in:
parent
3a4c71dc22
commit
53084abb75
10 changed files with 45 additions and 45 deletions
|
@ -1207,13 +1207,13 @@ class api {
|
||||||
|
|
||||||
// We can allow guest user to pass they will not have LP.
|
// We can allow guest user to pass they will not have LP.
|
||||||
if ($USER->id != $userid) {
|
if ($USER->id != $userid) {
|
||||||
require_capability('tool/lp:planviewall', $context);
|
require_capability('tool/lp:planview', $context);
|
||||||
} else {
|
} else {
|
||||||
require_capability('tool/lp:planviewown', $context);
|
require_capability('tool/lp:planviewown', $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Users that can manage plans can only see active and completed plans.
|
// Users that can manage plans can only see active and completed plans.
|
||||||
if (!has_any_capability(array('tool/lp:planmanageall', 'tool/lp:planmanageown', 'tool/lp:plancreatedraft'), $context)) {
|
if (!has_any_capability(array('tool/lp:planmanage', 'tool/lp:planmanageown', 'tool/lp:plancreateown'), $context)) {
|
||||||
$select = ' AND status != :statusdraft';
|
$select = ' AND status != :statusdraft';
|
||||||
$params['statusdraft'] = plan::STATUS_DRAFT;
|
$params['statusdraft'] = plan::STATUS_DRAFT;
|
||||||
}
|
}
|
||||||
|
@ -1232,16 +1232,16 @@ class api {
|
||||||
|
|
||||||
$context = context_user::instance($record->userid);
|
$context = context_user::instance($record->userid);
|
||||||
|
|
||||||
$manageplans = has_capability('tool/lp:planmanageall', $context);
|
$manageplans = has_capability('tool/lp:planmanage', $context);
|
||||||
$createdraft = has_capability('tool/lp:plancreatedraft', $context);
|
$createdraft = has_capability('tool/lp:plancreateown', $context);
|
||||||
$manageownplan = has_capability('tool/lp:planmanageown', $context);
|
$manageownplan = has_capability('tool/lp:planmanageown', $context);
|
||||||
|
|
||||||
// Any of them is enough.
|
// Any of them is enough.
|
||||||
if ($USER->id == $record->userid && !$manageplans && !$createdraft && !$manageownplan) {
|
if ($USER->id == $record->userid && !$manageplans && !$createdraft && !$manageownplan) {
|
||||||
// Exception about plancreatedraft as it is the one that is closer to basic users.
|
// Exception about plancreateown as it is the one that is closer to basic users.
|
||||||
throw new required_capability_exception($context, 'tool/lp:plancreatedraft', 'nopermissions', '');
|
throw new required_capability_exception($context, 'tool/lp:plancreateown', 'nopermissions', '');
|
||||||
} else if ($USER->id != $record->userid && !$manageplans) {
|
} else if ($USER->id != $record->userid && !$manageplans) {
|
||||||
throw new required_capability_exception($context, 'tool/lp:planmanageall', 'nopermissions', '');
|
throw new required_capability_exception($context, 'tool/lp:planmanage', 'nopermissions', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($record->status)) {
|
if (!isset($record->status)) {
|
||||||
|
@ -1268,15 +1268,15 @@ class api {
|
||||||
|
|
||||||
$context = context_user::instance($record->userid);
|
$context = context_user::instance($record->userid);
|
||||||
|
|
||||||
$manageplans = has_capability('tool/lp:planmanageall', $context);
|
$manageplans = has_capability('tool/lp:planmanage', $context);
|
||||||
$createdraft = has_capability('tool/lp:plancreatedraft', $context);
|
$createdraft = has_capability('tool/lp:plancreateown', $context);
|
||||||
$manageownplan = has_capability('tool/lp:planmanageown', $context);
|
$manageownplan = has_capability('tool/lp:planmanageown', $context);
|
||||||
|
|
||||||
// Any of them is enough.
|
// Any of them is enough.
|
||||||
if ($USER->id == $record->userid && !$manageplans && !$createdraft && !$manageownplan) {
|
if ($USER->id == $record->userid && !$manageplans && !$createdraft && !$manageownplan) {
|
||||||
throw new required_capability_exception($context, 'tool/lp:planmanageown', 'nopermissions', '');
|
throw new required_capability_exception($context, 'tool/lp:planmanageown', 'nopermissions', '');
|
||||||
} else if (!$manageplans) {
|
} else if (!$manageplans) {
|
||||||
throw new required_capability_exception($context, 'tool/lp:planmanageall', 'nopermissions', '');
|
throw new required_capability_exception($context, 'tool/lp:planmanage', 'nopermissions', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
$plan = new plan($record->id);
|
$plan = new plan($record->id);
|
||||||
|
@ -1286,7 +1286,7 @@ class api {
|
||||||
if (!$manageplans && !$manageownplan && $USER->id != $plan->get_usermodified()) {
|
if (!$manageplans && !$manageownplan && $USER->id != $plan->get_usermodified()) {
|
||||||
throw new \moodle_exception('erroreditingmodifiedplan', 'tool_lp');
|
throw new \moodle_exception('erroreditingmodifiedplan', 'tool_lp');
|
||||||
} else if (!$manageplans && $USER->id != $plan->get_userid()) {
|
} else if (!$manageplans && $USER->id != $plan->get_userid()) {
|
||||||
throw new required_capability_exception($context, 'tool/lp:planmanageall', 'nopermissions', '');
|
throw new required_capability_exception($context, 'tool/lp:planmanage', 'nopermissions', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the user can only create drafts we don't allow them to set other status.
|
// If the user can only create drafts we don't allow them to set other status.
|
||||||
|
@ -1313,14 +1313,14 @@ class api {
|
||||||
if ($USER->id == $plan->get_userid()) {
|
if ($USER->id == $plan->get_userid()) {
|
||||||
require_capability('tool/lp:planviewown', $context);
|
require_capability('tool/lp:planviewown', $context);
|
||||||
} else {
|
} else {
|
||||||
require_capability('tool/lp:planviewall', $context);
|
require_capability('tool/lp:planview', $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We require any of these capabilities to retrieve draft plans.
|
// We require any of these capabilities to retrieve draft plans.
|
||||||
if ($plan->get_status() == plan::STATUS_DRAFT &&
|
if ($plan->get_status() == plan::STATUS_DRAFT &&
|
||||||
!has_any_capability(array('tool/lp:planmanageown', 'tool/lp:planmanageall', 'tool/lp:plancreatedraft'), $context)) {
|
!has_any_capability(array('tool/lp:planmanageown', 'tool/lp:planmanage', 'tool/lp:plancreateown'), $context)) {
|
||||||
// Exception about plancreatedraft as it is the one that is closer to basic users.
|
// Exception about plancreateown as it is the one that is closer to basic users.
|
||||||
throw new required_capability_exception($context, 'tool/lp:plancreatedraft', 'nopermissions', '');
|
throw new required_capability_exception($context, 'tool/lp:plancreateown', 'nopermissions', '');
|
||||||
}
|
}
|
||||||
return $plan;
|
return $plan;
|
||||||
}
|
}
|
||||||
|
@ -1338,7 +1338,7 @@ class api {
|
||||||
|
|
||||||
$context = context_user::instance($plan->get_userid());
|
$context = context_user::instance($plan->get_userid());
|
||||||
|
|
||||||
$manageplans = has_capability('tool/lp:planmanageall', $context);
|
$manageplans = has_capability('tool/lp:planmanage', $context);
|
||||||
$manageownplan = has_capability('tool/lp:planmanageown', $context);
|
$manageownplan = has_capability('tool/lp:planmanageown', $context);
|
||||||
|
|
||||||
if ($USER->id == $plan->get_userid() && $USER->id != $plan->get_usermodified() &&
|
if ($USER->id == $plan->get_userid() && $USER->id != $plan->get_usermodified() &&
|
||||||
|
@ -1347,7 +1347,7 @@ class api {
|
||||||
throw new required_capability_exception($context, 'tool/lp:planmanageown', 'nopermissions', '');
|
throw new required_capability_exception($context, 'tool/lp:planmanageown', 'nopermissions', '');
|
||||||
} else if ($USER->id != $plan->get_userid() && !$manageplans) {
|
} else if ($USER->id != $plan->get_userid() && !$manageplans) {
|
||||||
// Other users needs to have tool/lp:planmanage.
|
// Other users needs to have tool/lp:planmanage.
|
||||||
throw new required_capability_exception($context, 'tool/lp:planmanageall', 'nopermissions', '');
|
throw new required_capability_exception($context, 'tool/lp:planmanage', 'nopermissions', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $plan->delete();
|
return $plan->delete();
|
||||||
|
|
|
@ -101,7 +101,7 @@ class plan extends persistent {
|
||||||
$context = context_user::instance($userid);
|
$context = context_user::instance($userid);
|
||||||
|
|
||||||
// Not all users can edit all plans, the template should know about it.
|
// Not all users can edit all plans, the template should know about it.
|
||||||
if (has_capability('tool/lp:planmanageall', $context) ||
|
if (has_capability('tool/lp:planmanage', $context) ||
|
||||||
has_capability('tool/lp:planmanageown', $context)) {
|
has_capability('tool/lp:planmanageown', $context)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,14 +60,14 @@ $capabilities = array(
|
||||||
),
|
),
|
||||||
'clonepermissionsfrom' => 'moodle/block:view'
|
'clonepermissionsfrom' => 'moodle/block:view'
|
||||||
),
|
),
|
||||||
'tool/lp:plancreatedraft' => array(
|
'tool/lp:plancreateown' => array(
|
||||||
'captype' => 'write',
|
'captype' => 'write',
|
||||||
'contextlevel' => CONTEXT_SYSTEM,
|
'contextlevel' => CONTEXT_USER,
|
||||||
'archetypes' => array(
|
'archetypes' => array(
|
||||||
),
|
),
|
||||||
'clonepermissionsfrom' => 'moodle/site:config'
|
'clonepermissionsfrom' => 'moodle/site:config'
|
||||||
),
|
),
|
||||||
'tool/lp:planmanageall' => array(
|
'tool/lp:planmanage' => array(
|
||||||
'captype' => 'write',
|
'captype' => 'write',
|
||||||
'contextlevel' => CONTEXT_SYSTEM,
|
'contextlevel' => CONTEXT_SYSTEM,
|
||||||
'archetypes' => array(
|
'archetypes' => array(
|
||||||
|
@ -81,7 +81,7 @@ $capabilities = array(
|
||||||
),
|
),
|
||||||
'clonepermissionsfrom' => 'moodle/site:config'
|
'clonepermissionsfrom' => 'moodle/site:config'
|
||||||
),
|
),
|
||||||
'tool/lp:planviewall' => array(
|
'tool/lp:planview' => array(
|
||||||
'captype' => 'read',
|
'captype' => 'read',
|
||||||
'contextlevel' => CONTEXT_USER,
|
'contextlevel' => CONTEXT_USER,
|
||||||
'archetypes' => array(
|
'archetypes' => array(
|
||||||
|
|
|
@ -346,7 +346,7 @@ $functions = array(
|
||||||
'classpath' => '',
|
'classpath' => '',
|
||||||
'description' => 'Creates a learning plan.',
|
'description' => 'Creates a learning plan.',
|
||||||
'type' => 'write',
|
'type' => 'write',
|
||||||
'capabilities' => 'tool/lp:planmanageall',
|
'capabilities' => 'tool/lp:planmanage',
|
||||||
),
|
),
|
||||||
'tool_lp_update_plan' => array(
|
'tool_lp_update_plan' => array(
|
||||||
'classname' => 'tool_lp\external',
|
'classname' => 'tool_lp\external',
|
||||||
|
@ -354,7 +354,7 @@ $functions = array(
|
||||||
'classpath' => '',
|
'classpath' => '',
|
||||||
'description' => 'Updates a learning plan.',
|
'description' => 'Updates a learning plan.',
|
||||||
'type' => 'write',
|
'type' => 'write',
|
||||||
'capabilities' => 'tool/lp:planmanageall',
|
'capabilities' => 'tool/lp:planmanage',
|
||||||
),
|
),
|
||||||
'tool_lp_read_plan' => array(
|
'tool_lp_read_plan' => array(
|
||||||
'classname' => 'tool_lp\external',
|
'classname' => 'tool_lp\external',
|
||||||
|
@ -370,7 +370,7 @@ $functions = array(
|
||||||
'classpath' => '',
|
'classpath' => '',
|
||||||
'description' => 'Delete a learning plan.',
|
'description' => 'Delete a learning plan.',
|
||||||
'type' => 'write',
|
'type' => 'write',
|
||||||
'capabilities' => 'tool/lp:planmanageall',
|
'capabilities' => 'tool/lp:planmanage',
|
||||||
),
|
),
|
||||||
'tool_lp_data_for_plans_page' => array(
|
'tool_lp_data_for_plans_page' => array(
|
||||||
'classname' => 'tool_lp\external',
|
'classname' => 'tool_lp\external',
|
||||||
|
|
|
@ -55,12 +55,12 @@ $PAGE->set_pagelayout('admin');
|
||||||
$PAGE->set_heading($pagetitle);
|
$PAGE->set_heading($pagetitle);
|
||||||
$output = $PAGE->get_renderer('tool_lp');
|
$output = $PAGE->get_renderer('tool_lp');
|
||||||
|
|
||||||
$manageplans = has_capability('tool/lp:planmanageall', $context);
|
$manageplans = has_capability('tool/lp:planmanage', $context);
|
||||||
$owncapabilities = array('tool/lp:plancreatedraft', 'tool/lp:planmanageown');
|
$owncapabilities = array('tool/lp:plancreateown', 'tool/lp:planmanageown');
|
||||||
if ($USER->id === $userid && !has_any_capability($owncapabilities, $context) && !$manageplans) {
|
if ($USER->id === $userid && !has_any_capability($owncapabilities, $context) && !$manageplans) {
|
||||||
throw new required_capability_exception($context, 'tool/lp:planmanageown', 'nopermissions', '');
|
throw new required_capability_exception($context, 'tool/lp:planmanageown', 'nopermissions', '');
|
||||||
} else if (!$manageplans) {
|
} else if (!$manageplans) {
|
||||||
throw new required_capability_exception($context, 'tool/lp:planmanageall', 'nopermissions', '');
|
throw new required_capability_exception($context, 'tool/lp:planmanage', 'nopermissions', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Passing the templates list to the form.
|
// Passing the templates list to the form.
|
||||||
|
|
|
@ -84,10 +84,10 @@ $string['lp:competencymanage'] = 'Manage competency frameworks';
|
||||||
$string['lp:competencyread'] = 'View competency frameworks';
|
$string['lp:competencyread'] = 'View competency frameworks';
|
||||||
$string['lp:coursecompetencymanage'] = 'Manage course competencies';
|
$string['lp:coursecompetencymanage'] = 'Manage course competencies';
|
||||||
$string['lp:coursecompetencyread'] = 'View course competencies';
|
$string['lp:coursecompetencyread'] = 'View course competencies';
|
||||||
$string['lp:plancreatedraft'] = 'Create draft learning plans';
|
$string['lp:plancreateown'] = 'Create own learning plans';
|
||||||
$string['lp:planmanageall'] = 'Manage learning plans';
|
$string['lp:planmanage'] = 'Manage learning plans';
|
||||||
$string['lp:planmanageown'] = 'Manage own learning plans';
|
$string['lp:planmanageown'] = 'Manage own learning plans';
|
||||||
$string['lp:planviewall'] = 'View all learning plans';
|
$string['lp:planview'] = 'View all learning plans';
|
||||||
$string['lp:planviewown'] = 'View own learning plans';
|
$string['lp:planviewown'] = 'View own learning plans';
|
||||||
$string['lp:templatemanage'] = 'Manage templates';
|
$string['lp:templatemanage'] = 'Manage templates';
|
||||||
$string['lp:templateread'] = 'View template';
|
$string['lp:templateread'] = 'View template';
|
||||||
|
|
|
@ -60,7 +60,7 @@ function tool_lp_myprofile_navigation(core_user\output\myprofile\tree $tree, $us
|
||||||
global $USER;
|
global $USER;
|
||||||
|
|
||||||
$context = context_user::instance($USER->id);
|
$context = context_user::instance($USER->id);
|
||||||
if (!$iscurrentuser && !has_capability('tool/lp:planviewall', $context)) {
|
if (!$iscurrentuser && !has_capability('tool/lp:planview', $context)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,11 +43,11 @@ if (!$user || !core_user::is_real_user($userid)) {
|
||||||
throw new moodle_exception('invaliduser', 'error');
|
throw new moodle_exception('invaliduser', 'error');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!has_capability('tool/lp:planviewall', $context)) {
|
if (!has_capability('tool/lp:planview', $context)) {
|
||||||
if ($iscurrentuser) {
|
if ($iscurrentuser) {
|
||||||
require_capability('tool/lp:planviewown', $context);
|
require_capability('tool/lp:planviewown', $context);
|
||||||
} else {
|
} else {
|
||||||
throw new required_capability_exception($context, 'tool/lp:planviewall', 'nopermissions', '');
|
throw new required_capability_exception($context, 'tool/lp:planview', 'nopermissions', '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,9 +99,9 @@ class tool_lp_external_testcase extends externallib_advanced_testcase {
|
||||||
// Reset all default authenticated users permissions.
|
// Reset all default authenticated users permissions.
|
||||||
unassign_capability('tool/lp:competencymanage', $authrole->id);
|
unassign_capability('tool/lp:competencymanage', $authrole->id);
|
||||||
unassign_capability('tool/lp:competencyread', $authrole->id);
|
unassign_capability('tool/lp:competencyread', $authrole->id);
|
||||||
unassign_capability('tool/lp:planmanageall', $authrole->id);
|
unassign_capability('tool/lp:planmanage', $authrole->id);
|
||||||
unassign_capability('tool/lp:planmanageown', $authrole->id);
|
unassign_capability('tool/lp:planmanageown', $authrole->id);
|
||||||
unassign_capability('tool/lp:planviewall', $authrole->id);
|
unassign_capability('tool/lp:planview', $authrole->id);
|
||||||
unassign_capability('tool/lp:templatemanage', $authrole->id);
|
unassign_capability('tool/lp:templatemanage', $authrole->id);
|
||||||
unassign_capability('tool/lp:templateread', $authrole->id);
|
unassign_capability('tool/lp:templateread', $authrole->id);
|
||||||
|
|
||||||
|
@ -111,9 +111,9 @@ class tool_lp_external_testcase extends externallib_advanced_testcase {
|
||||||
|
|
||||||
assign_capability('tool/lp:competencymanage', CAP_ALLOW, $this->creatorrole, $syscontext->id);
|
assign_capability('tool/lp:competencymanage', CAP_ALLOW, $this->creatorrole, $syscontext->id);
|
||||||
assign_capability('tool/lp:competencyread', CAP_ALLOW, $this->userrole, $syscontext->id);
|
assign_capability('tool/lp:competencyread', CAP_ALLOW, $this->userrole, $syscontext->id);
|
||||||
assign_capability('tool/lp:planmanageall', CAP_ALLOW, $this->creatorrole, $syscontext->id);
|
assign_capability('tool/lp:planmanage', CAP_ALLOW, $this->creatorrole, $syscontext->id);
|
||||||
assign_capability('tool/lp:planmanageown', CAP_ALLOW, $this->creatorrole, $syscontext->id);
|
assign_capability('tool/lp:planmanageown', CAP_ALLOW, $this->creatorrole, $syscontext->id);
|
||||||
assign_capability('tool/lp:planviewall', CAP_ALLOW, $this->creatorrole, $syscontext->id);
|
assign_capability('tool/lp:planview', CAP_ALLOW, $this->creatorrole, $syscontext->id);
|
||||||
assign_capability('tool/lp:templatemanage', CAP_ALLOW, $this->creatorrole, $syscontext->id);
|
assign_capability('tool/lp:templatemanage', CAP_ALLOW, $this->creatorrole, $syscontext->id);
|
||||||
assign_capability('tool/lp:templateread', CAP_ALLOW, $this->userrole, $syscontext->id);
|
assign_capability('tool/lp:templateread', CAP_ALLOW, $this->userrole, $syscontext->id);
|
||||||
|
|
||||||
|
@ -1052,7 +1052,7 @@ class tool_lp_external_testcase extends externallib_advanced_testcase {
|
||||||
$this->assertEquals('nopermissions', $e->errorcode);
|
$this->assertEquals('nopermissions', $e->errorcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
assign_capability('tool/lp:plancreatedraft', CAP_ALLOW, $this->userrole, $syscontext->id);
|
assign_capability('tool/lp:plancreateown', CAP_ALLOW, $this->userrole, $syscontext->id);
|
||||||
accesslib_clear_all_caches_for_unit_testing();
|
accesslib_clear_all_caches_for_unit_testing();
|
||||||
|
|
||||||
$this->setUser($this->user);
|
$this->setUser($this->user);
|
||||||
|
@ -1095,7 +1095,7 @@ class tool_lp_external_testcase extends externallib_advanced_testcase {
|
||||||
}
|
}
|
||||||
|
|
||||||
unassign_capability('tool/lp:planmanageown', $this->userrole, $syscontext->id);
|
unassign_capability('tool/lp:planmanageown', $this->userrole, $syscontext->id);
|
||||||
unassign_capability('tool/lp:plancreatedraft', $this->userrole, $syscontext->id);
|
unassign_capability('tool/lp:plancreateown', $this->userrole, $syscontext->id);
|
||||||
accesslib_clear_all_caches_for_unit_testing();
|
accesslib_clear_all_caches_for_unit_testing();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -1133,7 +1133,7 @@ class tool_lp_external_testcase extends externallib_advanced_testcase {
|
||||||
$plan2['usercanupdate'] = false;
|
$plan2['usercanupdate'] = false;
|
||||||
$plan3['usercanupdate'] = false;
|
$plan3['usercanupdate'] = false;
|
||||||
|
|
||||||
// You need planmanage, planmanageown or plancreatedraft to see draft plans.
|
// You need planmanage, planmanageown or plancreateown to see draft plans.
|
||||||
try {
|
try {
|
||||||
external::read_plan($plan1['id']);
|
external::read_plan($plan1['id']);
|
||||||
$this->fail('Exception expected due to not permissions to read draft plan');
|
$this->fail('Exception expected due to not permissions to read draft plan');
|
||||||
|
@ -1143,13 +1143,13 @@ class tool_lp_external_testcase extends externallib_advanced_testcase {
|
||||||
$this->assertEquals((Array)$plan2, external::read_plan($plan2['id']));
|
$this->assertEquals((Array)$plan2, external::read_plan($plan2['id']));
|
||||||
$this->assertEquals((Array)$plan3, external::read_plan($plan3['id']));
|
$this->assertEquals((Array)$plan3, external::read_plan($plan3['id']));
|
||||||
|
|
||||||
assign_capability('tool/lp:plancreatedraft', CAP_ALLOW, $this->userrole, $syscontext->id);
|
assign_capability('tool/lp:plancreateown', CAP_ALLOW, $this->userrole, $syscontext->id);
|
||||||
accesslib_clear_all_caches_for_unit_testing();
|
accesslib_clear_all_caches_for_unit_testing();
|
||||||
|
|
||||||
$this->assertEquals((Array)$plan1, external::read_plan($plan1['id']));
|
$this->assertEquals((Array)$plan1, external::read_plan($plan1['id']));
|
||||||
|
|
||||||
assign_capability('tool/lp:planviewown', CAP_PROHIBIT, $this->userrole, $syscontext->id);
|
assign_capability('tool/lp:planviewown', CAP_PROHIBIT, $this->userrole, $syscontext->id);
|
||||||
unassign_capability('tool/lp:plancreatedraft', $this->userrole, $syscontext->id);
|
unassign_capability('tool/lp:plancreateown', $this->userrole, $syscontext->id);
|
||||||
accesslib_clear_all_caches_for_unit_testing();
|
accesslib_clear_all_caches_for_unit_testing();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -1171,7 +1171,7 @@ class tool_lp_external_testcase extends externallib_advanced_testcase {
|
||||||
|
|
||||||
$this->assertTrue(external::delete_plan($plan1['id']));
|
$this->assertTrue(external::delete_plan($plan1['id']));
|
||||||
|
|
||||||
unassign_capability('tool/lp:planmanageall', $this->creatorrole, $syscontext->id);
|
unassign_capability('tool/lp:planmanage', $this->creatorrole, $syscontext->id);
|
||||||
accesslib_clear_all_caches_for_unit_testing();
|
accesslib_clear_all_caches_for_unit_testing();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
|
|
||||||
$plugin->version = 2015052416; // The current plugin version (Date: YYYYMMDDXX).
|
$plugin->version = 2015052418; // The current plugin version (Date: YYYYMMDDXX).
|
||||||
$plugin->requires = 2014110400; // Requires this Moodle version.
|
$plugin->requires = 2014110400; // Requires this Moodle version.
|
||||||
$plugin->component = 'tool_lp'; // Full name of the plugin (used for diagnostics).
|
$plugin->component = 'tool_lp'; // Full name of the plugin (used for diagnostics).
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue