From f8b463e394f7fec04f5c58aaecd9d4db833b120e Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Tue, 3 Jan 2023 21:26:04 +0000 Subject: [PATCH] MDL-76787 tiny_h5p: correct capability for plugin enabled state. --- lib/editor/tiny/plugins/h5p/classes/plugininfo.php | 2 +- .../tiny/plugins/h5p/tests/behat/h5p.feature | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/editor/tiny/plugins/h5p/classes/plugininfo.php b/lib/editor/tiny/plugins/h5p/classes/plugininfo.php index 35dc467b0bc..df42dbd3a1a 100644 --- a/lib/editor/tiny/plugins/h5p/classes/plugininfo.php +++ b/lib/editor/tiny/plugins/h5p/classes/plugininfo.php @@ -41,7 +41,7 @@ class plugininfo extends plugin implements ?\editor_tiny\editor $editor = null ): bool { // Users must have permission to embed content. - return has_capability('atto/h5p:addembed', $context); + return has_capability('tiny/h5p:addembed', $context); } public static function get_available_buttons(): array { diff --git a/lib/editor/tiny/plugins/h5p/tests/behat/h5p.feature b/lib/editor/tiny/plugins/h5p/tests/behat/h5p.feature index a6f48937f4a..16266086885 100644 --- a/lib/editor/tiny/plugins/h5p/tests/behat/h5p.feature +++ b/lib/editor/tiny/plugins/h5p/tests/behat/h5p.feature @@ -1,4 +1,4 @@ -@editor @editor_tiny @tiny_media @javascript @_file_upload +@editor @editor_tiny @tiny_h5p @javascript @_file_upload Feature: Use the TinyMCE editor to upload an h5p package In order to work with h5p As a content creator @@ -58,21 +58,9 @@ Feature: Use the TinyMCE editor to upload an h5p package Given the following "permission overrides" exist: | capability | permission | role | contextlevel | reference | | tiny/h5p:addembed | Prohibit | editingteacher | Course | C1 | - | moodle/h5p:deploy | Prohibit | editingteacher | Course | C1 | When I am on the PageName1 "page activity editing" page logged in as teacher1 Then "Configure H5P content" "button" should not exist - @javascript - Scenario: When a user does not have the Embed H5P capability, they cannot embed H5P content with TinyMCE - Given the following "permission overrides" exist: - | capability | permission | role | contextlevel | reference | - | tiny/h5p:addembed | Prohibit | editingteacher | Course | C1 | - And I am on the PageName1 "page activity editing" page logged in as teacher1 - And I click on "Configure H5P" "button" - Then I should not see "H5P URL" in the "Insert H5P content" "dialogue" - And I should see "H5P file upload" in the "Insert H5P content" "dialogue" - And I should see "H5P options" in the "Insert H5P content" "dialogue" - @javascript Scenario: When a user does not have the Upload H5P capability, they can embed but not upload H5P content with TinyMCE Given the following "permission overrides" exist: