Skip to content

Commit

Permalink
Capabilities fixing and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rrusso committed Feb 1, 2017
1 parent 07f563f commit 6a7a364
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion category_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
$PAGE->set_context($context);

require_login();
require_capability('local/cas_help_links:editglobalsettings', $context);
require_capability('local/cas_help_links:editcategorysettings', $context);

//////////////////////////////////////////////////////////
///
Expand Down
2 changes: 1 addition & 1 deletion classes/url_generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static function getUrlForUser($user_id) {
if (\ues_user::is_teacher($user_id)) {
// return edit link
return self::getCourseEditHelpUrl();
} else if (has_capability('local/cas_help_links:editglobalsettings', context_system::instance())) {
} else if (has_capability('local/cas_help_links:editcategorysettings', context_system::instance())) {
return self::getCategoryEditHelpUrl();
} else {
// otherwise rdo not display
Expand Down
12 changes: 1 addition & 11 deletions db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,11 @@
defined('MOODLE_INTERNAL') || die();

$capabilities = array(

'local/cas_help_links:editglobalsettings' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
),
),

'local/cas_help_links:editcategorysettings' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
'coursecreator' => CAP_ALLOW
),
),

);
2 changes: 1 addition & 1 deletion settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

defined('MOODLE_INTERNAL') || die();

if (is_siteadmin() || has_capability('local/cas_help_links:editglobalsettings', context_system::instance())) {
if (is_siteadmin()) {

require_once(dirname(__FILE__) . '/../../config.php');
require_once($CFG->libdir . '/adminlib.php');
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2017013101;
$plugin->version = 2017020101;
$plugin->requires = 2014051200;
$plugin->cron = 0;
$plugin->component = 'local_cas_help_links';
Expand Down

0 comments on commit 6a7a364

Please sign in to comment.