2017-01-28 00:08:10 +08:00
|
|
|
module Lti
|
|
|
|
class CapabilitiesHelper
|
2017-02-08 04:51:01 +08:00
|
|
|
SUPPORTED_CAPABILITIES = %w(ToolConsumerInstance.guid
|
|
|
|
CourseSection.sourcedId
|
|
|
|
Membership.role
|
|
|
|
Person.email.primary
|
|
|
|
Person.name.given
|
|
|
|
Person.name.family
|
|
|
|
Person.name.full
|
|
|
|
Person.sourcedId
|
|
|
|
User.id
|
|
|
|
User.image
|
|
|
|
Message.documentTarget
|
|
|
|
Message.locale
|
2017-02-15 04:24:04 +08:00
|
|
|
Context.id
|
|
|
|
vnd.Canvas.root_account.uuid).freeze
|
2017-01-28 00:08:10 +08:00
|
|
|
|
2017-02-08 04:51:01 +08:00
|
|
|
def self.supported_capabilities
|
|
|
|
SUPPORTED_CAPABILITIES
|
2017-01-28 00:08:10 +08:00
|
|
|
end
|
|
|
|
|
2017-02-08 04:51:01 +08:00
|
|
|
def self.filter_capabilities(enabled_capability)
|
|
|
|
enabled_capability & SUPPORTED_CAPABILITIES
|
2017-01-28 00:08:10 +08:00
|
|
|
end
|
|
|
|
|
2017-02-08 04:51:01 +08:00
|
|
|
def self.capability_params_hash(enabled_capability, variable_expander)
|
|
|
|
variable_expander.enabled_capability_params(filter_capabilities(enabled_capability))
|
2017-01-28 00:08:10 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|