Skip to content

Commit

Permalink
MDL-52235 tool_lp: Check capability on Add new learning plan button
Browse files Browse the repository at this point in the history
  • Loading branch information
taboubi authored and Frederic Massart committed Apr 18, 2016
1 parent dd1ce76 commit 768181b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions admin/tool/lp/classes/output/plans_page.php
Expand Up @@ -66,11 +66,13 @@ public function __construct($userid) {

$this->context = context_user::instance($userid);

$addplan = new single_button(
new moodle_url('/admin/tool/lp/editplan.php', array('userid' => $userid)),
get_string('addnewplan', 'tool_lp')
);
$this->navigation[] = $addplan;
if (plan::can_manage_user($userid) || plan::can_manage_user_draft($userid)) {
$addplan = new single_button(
new moodle_url('/admin/tool/lp/editplan.php', array('userid' => $userid)),
get_string('addnewplan', 'tool_lp')
);
$this->navigation[] = $addplan;
}
}

/**
Expand Down

0 comments on commit 768181b

Please sign in to comment.