diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 88bbf4cff..536897526 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -189,6 +189,10 @@ def set_lti_launch_values @is_lti_launch = true @canvas_url = current_application_instance.site.url @app_name = current_application_instance.application.client_application_name + context_id = params[:context_id] + if current_user&.can_author?(context_id, current_application_instance) + @can_author = true + end end def set_lti_advantage_launch_values @@ -202,6 +206,11 @@ def set_lti_advantage_launch_values @app_name = current_application_instance.application.client_application_name @title = current_application_instance.application.name @description = current_application_instance.application.description + + context_id = @lti_token[LtiAdvantage::Definitions::CONTEXT_CLAIM]["id"] + if current_user&.can_author?(context_id, current_application_instance) + @can_author = true + end end def targeted_app_instance diff --git a/app/controllers/concerns/deep_linking.rb b/app/controllers/concerns/deep_linking.rb index 4bb28032d..3c271c9fa 100644 --- a/app/controllers/concerns/deep_linking.rb +++ b/app/controllers/concerns/deep_linking.rb @@ -32,6 +32,7 @@ def create_deep_link_jwt( jwt_context_id: jwt_context_id, jwt_tool_consumer_instance_guid: jwt_tool_consumer_instance_guid, host: host, + application_instance: application_instance, ), } @@ -48,14 +49,32 @@ def content_items( params:, jwt_context_id:, jwt_tool_consumer_instance_guid:, - host: + host:, + application_instance: ) out = [] if params[:type] == "html" out << { "type" => "html", - "html" => "
+ See + + https://www.imsglobal.org/spec/lti-dl/v2p0#content-item-types + + for examples of item types that can be provided via deep linking. +
{data.welcomeMessage} diff --git a/client/apps/hello_world_graphql/components/layout/index.jsx b/client/apps/hello_world_graphql/components/layout/index.jsx index 42b85b785..960683c8a 100644 --- a/client/apps/hello_world_graphql/components/layout/index.jsx +++ b/client/apps/hello_world_graphql/components/layout/index.jsx @@ -5,6 +5,7 @@ import { withSettings } from 'atomic-fuel/libs/components/settings'; import { displayCanvasAuth } from '../../../../common/components/common/canvas_auth'; import Home from '../home'; +import Setup from '../setup'; import NotFound from '../common/not_found'; import { canAdmin } from '../../../../common/utils'; @@ -13,7 +14,8 @@ export class Index extends React.Component { static propTypes = { settings: PropTypes.shape({ lti_launch_config: PropTypes.shape({ - discussion_id: PropTypes.number + discussion_id: PropTypes.number, + title: PropTypes.string }) }) }; @@ -22,6 +24,7 @@ export class Index extends React.Component { return (
+ Please select an existing instance: +
+