Skip to content

Commit

Permalink
ELIS 2.5.9.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
brentboghosian committed Jan 5, 2015
1 parent 383b502 commit 60af4f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
26 changes: 12 additions & 14 deletions core/repository/elis_files/lib/ELIS_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -3202,21 +3202,19 @@ function get_other_capabilities($user, &$capabilities) {

// Look for these permissions anywhere in the system
foreach ($capabilities as $capability => $value) {
$sql = "SELECT ra.*
FROM {role_assignments} ra
INNER JOIN {role_capabilities} rc ON rc.roleid = ra.roleid
WHERE ra.userid = :userid
AND rc.capability = :capability
AND rc.permission = :permission";

$params = array(
'userid' => $user->id,
'capability' => $capability,
'permission' => CAP_ALLOW
);

if ($DB->record_exists_sql($sql, $params)) {
if (has_capability($capability, context_system::instance(), $user)) {
$capabilities[$capability] = true;
} else {
$roles = get_roles_with_capability($capability, CAP_ALLOW);
if (!empty($roles)) {
$sql = 'SELECT ra.id
FROM {role_assignments} ra
WHERE ra.userid = ? AND ra.roleid IN ('.implode(', ', array_keys($roles)).')';
$params = array($user->id);
if ($DB->record_exists_sql($sql, $params)) {
$capabilities[$capability] = true;
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/repository/elis_files/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
defined('MOODLE_INTERNAL') || die();

$plugin->version = 2013082100;
$plugin->release = '2.5.7.1 (Build: 20140826)';
$plugin->release = '2.5.9.1 (Build: 20141125)';
$plugin->dependencies = array(
'elis_core' => 2013082100
);

0 comments on commit 60af4f9

Please sign in to comment.