mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
MDL-34862 question preview: improve preview ownership check.
Users should only be able to access their own quetion preview. In the past, for reasons I can no longer remember, this was enforced using the session. It is much better to set the question_usage to belong to the user's context.
This commit is contained in:
parent
e6aac11d94
commit
94dd25e03b
2 changed files with 8 additions and 10 deletions
|
@ -63,7 +63,7 @@ class question_usage_by_activity {
|
|||
*/
|
||||
protected $preferredbehaviour = null;
|
||||
|
||||
/** @var object the context this usage belongs to. */
|
||||
/** @var context the context this usage belongs to. */
|
||||
protected $context;
|
||||
|
||||
/** @var string plugin name of the plugin this usage belongs to. */
|
||||
|
@ -104,7 +104,7 @@ class question_usage_by_activity {
|
|||
return $this->preferredbehaviour;
|
||||
}
|
||||
|
||||
/** @return object the context this usage belongs to. */
|
||||
/** @return context the context this usage belongs to. */
|
||||
public function get_owning_context() {
|
||||
return $this->context;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue