Namespace: Permissions

Permissions

Handle optional permissions

Source:

Members


<private, static, constant> _STATE :app.Permissions.State

Possible states of an app.Permissions.Type

Type:
Source:

<static, constant> BACKGROUND :app.Permissions.Type

Permission for running in background

Type:
Source:

<static> BACKGROUND :app.Permissions.Type

Type:
Source:

<static> PICASA :app.Permissions.Type

Type:
Source:

<static, constant> PICASA :app.Permissions.Type

Permission for access to users' Google Photos

Type:
Source:

Methods


<static> _contains(type) → {Promise.<boolean>}

Determine if we have the optional permissions

Parameters:
Name Type Description
type app.Permissions.Type

permission type

Source:
Returns:

true if we have permissions

Type
Promise.<boolean>

<private, static> _setState(type, value)

Persist the state of an app.Permissions.Type

Parameters:
Name Type Description
type app.Permissions.Type

permission type

value string

permission state

Source:

<static> isAllowed(type) → {boolean}

Has the user allowed the optional permissions

Parameters:
Name Type Description
type app.Permissions.Type

permission type

Source:
Returns:

true if allowed

Type
boolean

<static> notSet(type) → {boolean}

Has user made choice on permissions

Parameters:
Name Type Description
type app.Permissions.Type

permission type

Source:
Returns:

true if allowed or denied

Type
boolean

<static> remove(type) → {Promise.<boolean>}

Remove the optional permissions

Parameters:
Name Type Description
type app.Permissions.Type

permission type

Source:
Returns:

true if removed

Type
Promise.<boolean>

<static> request(type) → {Promise.<boolean>}

Request optional permission - may block

Parameters:
Name Type Description
type app.Permissions.Type

permission type

Source:
Returns:

true if permission granted

Type
Promise.<boolean>

Type Definitions


State

A permission state enum

Type:
  • Object
Properties:
Name Type Description
notSet string

never been allowed or denied

allowed string

user allowed

denied string

user denied

Source:

Type

A permission type

Type:
  • Object
Properties:
Name Type Description
name string

name in localStorage

permissions Array.<string>

array of permissions

origins Array.<string>

array of origins

Source: