Closed acquaalta closed 4 years ago
Hi Acquaalta, I agree with everything you suggest, and I will try to find a programmer to work on it.
Thanks a lot :-) BTW, There is a recent comment on the plugin page ("Katja Neubehler Tue, Dec 17, 2019, 6:27 PM"), which deals with more capabilities that are required for the correct functionality of the plugin.
This bug is fixed.
A more welcoming error message will be displayed if the user does not have the following capabilities: Restore activities (moodle/restore:restoreactivity) Restore courses (moodle/restore:restorecourse)
And the "Copy to course" icon will be removed as well if the user does not have the capabilities.
Versions Moodle: 3.7 Sharing Cart: 3.6, release 1 (2019012000)
Hi, A user in "my" system tried to copy an item using the sharing cart. She could use the "Edit" menu of the item to copy the item into the sharing cart, but when she clicked the "Copy to course" button in the "Sharing Cart" block, she got an exception message. When I turned on debugging and repeated what she did before, I got the following error:
Here is the same message in a text format: %%%%%%%%%%%%%%%%%%%% _required_capability_exception: Sorry, but you do not currently have permissions to do that (Restore courses). in [dirroot]/lib/accesslib.php:860 Stack trace: #0 [dirroot]/blocks/sharing_cart/classes/controller.php(435): require_capability('moodle/restore:...', Object(context_course)) #1 [dirroot]/blocks/sharing_cart/restore.php(111): sharing_cart\controller->restore(2, 284, 1) #2 {main}
More information about this error
×Debug info: Error code: notlocalisederrormessage ×Stack trace: line 494 of /lib/setuplib.php: moodle_exception thrown line 120 of /blocks/sharing_cart/restore.php: call to printerror() %%%%%%%%%%%%%%%%%%%%
I've got the following questions:
Could you please update the code of the plugin, so when a user doesn't have the required capabilities, he would see a "more welcoming" message that would tell him that he needs to have the X, Y and Z permissions in order to use the "Sharing Cart" block/mechanism? It would be best if it would see this message at the start, when he try to copy the item into the sharing cart, and not only when he tries to finish the process. I thought about even not displaying the "Copy to Sharing Cart" option in the edit menu from the beginning, but it seems too much, because at least when it is shown, the user knows that there is a general option in the system to use the sharing cart.
It seems that two capabilities are required by a user in order to use the plugin in the most basic scenario (copying an item): Restore activities (moodle/restore:restoreactivity) Restore courses (moodle/restore:restorecourse)
If that's true, could you please update the documentation of the plugin and include that info in it? One may assume that the plugin requires only one capability (activity/course), but it seems that in reality both are needed.