Class: AuthorizationManager

AuthorizationManager

new AuthorizationManager()

Helps coordinates the needs for DataServices to get the authorization they need to access data. It is meant to be a singleton, so the constructor enforces that.
Source:

Extends

  • external:Montage

Members

authorizationManagerPanel :string

Module ID of the panel that displays the UI specific to the authorization providers. Each authorization provider has a module ID pointing to a component which displays whatever UI is required to get authorization through that provider. The most common UI for applications with a single auth provider is a login form. The most common UI for applications with multiple providers is the view that shows a button for each provider and allows the user to select their preferred provider. For example, a button for each of Facebook, Linkedin, and Google. The authorizationManagerPanel is the container into which the provider-specific components are placed.
Type:
  • string
Source:

hasPendingServices :boolean

Flag to track the number of services pending on the AuthorizationManagerPanel. The value is true if 1 or more services is currently pending. It can be used as an alternative to runModal()/closeModal()
Type:
  • boolean
Source:

Methods

authorizeService(dataService)

Takes care of obtaining authorization for a DataService. Returns a promise of Authorization TODO: 1. Handle repeated calls: if a DataService authorizes on-demand it's likely it would come from fetching data. Multiple independent fetches could trigger repeated attempts to authorize: The promise should be cached and returned when pending. TODO: 2. A service could require mandatory authorization from 2 dataService, right now it's implemented in a way that we expect user to make a choice in one of aDataService.authorizationServices, not a combination of. We need another structure to represent that. TODO right now, Promises for existing objects are resolved, meaning that the loops could see different types of objects coming in. Existing objects could be just added to array filled after the Promise.all().then..
Parameters:
Name Type Description
dataService DataService A dataService for which to get an authorization
Source:

registerAuthorizationService(dataService)

Parameters:
Name Type Description
dataService DataService A dataService to be registered as an Authorization provider
Source: