Limiting Course Level LTI creation

Re: Limiting Course Level LTI creation

by Jake Dallimore -
Number of replies: 0
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Scott,

You've touched on an interesting area and may have highlighted a problem we've overlooked for years. After looking at the capability docs and the revision history (some of which goes back a long way), my take is as follows:
  1. The mod/lti:addcoursetool capability (https://docs.moodle.org/400/en/Capabilities/mod/lti:addcoursetool) was introduced well before LTI Advantage support was added, and in fact even before content selection (deep linking) support was added. Back then, it was added to control access to instructor_edit_tool_type.php. Back then, this was controlling the ability to add a full tool configuration to a specific course. Because we only supported 1.1 back then, a teacher was able create a course tool without the need to involve system admins, so this capability made sense as a way to control this. if users didn't have this, they couldn't create course-level tools. They could still use them, however.
  2. Content item selection (deep linking) support was then added in MDL-49609. That issue added the capability check (mod/lti:adcoursetool) to contentitem (Source code here) flows, but never tested that as far as I can see. There appears to be no discussion around this on the issue either, aside from "Add capability checks for contentitem and contentitem_return pages".
I think the content item message issue (2) incorrectly added that capability check (perhaps copy and paste from prior LTI code - I don't really know). There should be no reason a teacher can't use an existing preconfigured tool by selecting it from the list and then clicking "Select content" to pick a specific content item(s). This isn't creating a course level tool, it's just using an existing tool. Controlling it with this capability isn't right.

So, it certainly looks like we have an annoying bug there, but that doesn't help you right now.
And as best I can gather from the discussion, the expectation is that we... 1. remove mod/lti:addmanualinstance 2. ensure that on each external tool setup that we choose for "Tool configuration usage" to "Show in activity choose and as a preconfigured tool" This would show the preconfigured tool item in the activity choose, but not show the external tool item. Is this the only (or best) way to accomplish my goal?
I think this is indeed the only way to achieve what you want until the bug is fixed. I'll link a tracker issue here shortly dealing with addressing that.

Edit: See MDL-74797 dealing with the bug described above.

Hope that helps,
Jake