Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
fbf6cfe6
Commit
fbf6cfe6
authored
Apr 17, 2012
by
Jerome Mouneyrac
Browse files
MDL-30225 Creating new web service tokens create error
parent
668a499d
Changes
1
Hide whitespace changes
Inline
Side-by-side
webservice/lib.php
View file @
fbf6cfe6
...
...
@@ -515,9 +515,9 @@ class webservice {
public
function
get_user_capabilities
(
$userid
)
{
global
$DB
;
//retrieve the user capabilities
$sql
=
"SELECT rc.id, rc.capability FROM
{
role_capabilities
}
rc,
{
role_assignments
}
ra
WHERE rc.roleid=ra.roleid AND ra.userid= ?"
;
$dbusercaps
=
$DB
->
get_records_sql
(
$sql
,
array
(
$userid
));
$sql
=
"SELECT
DISTINCT
rc.id, rc.capability FROM
{
role_capabilities
}
rc,
{
role_assignments
}
ra
WHERE rc.roleid=ra.roleid AND ra.userid=
? AND rc.permission =
?"
;
$dbusercaps
=
$DB
->
get_records_sql
(
$sql
,
array
(
$userid
,
CAP_ALLOW
));
$usercaps
=
array
();
foreach
(
$dbusercaps
as
$usercap
)
{
$usercaps
[
$usercap
->
capability
]
=
true
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment