Skip to content
GitLab
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
19fa0921
Commit
19fa0921
authored
Jul 01, 2020
by
victor
🙇
Committed by
Jenkins
Jul 06, 2020
Browse files
MDL-69093 enrol_manual: added check for allowed roles a user can assign
parent
cb51c8ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
enrol/manual/ajax.php
View file @
19fa0921
...
...
@@ -97,6 +97,13 @@ switch ($action) {
if
(
empty
(
$roleid
))
{
$roleid
=
null
;
}
else
{
if
(
!
has_capability
(
'moodle/role:assign'
,
$context
))
{
throw
new
enrol_ajax_exception
(
'assignnotpermitted'
);
}
if
(
!
array_key_exists
(
$roleid
,
get_assignable_roles
(
$context
,
ROLENAME_ALIAS
,
false
)))
{
throw
new
enrol_ajax_exception
(
'invalidrole'
);
}
}
if
(
empty
(
$startdate
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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