Constructors
new SecurityManager()
new SecurityManager(): SecurityManager
Returns
SecurityManagerMethods
getCurrentContextCredential()
staticgetCurrentContextCredential():SecurityManagerTypes.ICredential
Returns
SecurityManagerTypes.ICredential
getMajorVersion()
Get the major version number. The major version number.staticgetMajorVersion():number
Returns
number
getMinorVersion()
Get the minor version number. The minor version number.staticgetMinorVersion():number
Returns
number
getPatchVersion()
Get the patch version number. The patch version number.staticgetPatchVersion():number
Returns
number
getPrivilegeState()
staticgetPrivilegeState(privilege:string, packageId?:string | undefined):Promise<SecurityManagerTypes.PrivilegeState>
Parameters
privilege
string
packageId?
string | undefined
Returns
Promise<SecurityManagerTypes.PrivilegeState>
getRuntimePrivilegeStates()
staticgetRuntimePrivilegeStates(credential:SecurityManagerTypes.ICredential):Promise<SecurityManagerTypes.IRuntimePrivilege[]>
Parameters
credential
SecurityManagerTypes.ICredential
Returns
Promise<SecurityManagerTypes.IRuntimePrivilege[]>
requestPrivilege()
Request permission to use a run-time privilegestaticrequestPrivilege(privilege:string):Promise<SecurityManagerTypes.PrivilegeState>
Parameters
privilege
string
The run-time privilege to request access to.
Returns
Promise<SecurityManagerTypes.PrivilegeState>
Promise<SecurityManagerTypes.PrivilegeState> On success, the promise is resolved
with the new state of the privilege for the calling package. On error, the promise is
rejected with one of the following error messages:
- “Failed to get privilege state” - An error occurred retrieving the new privilege state
- “Failed to launch privilege request handler” - An error occurred while attempting to launch a system component to get the user’s consent
requestPrivileges()
staticrequestPrivileges(privileges:string[]):Promise<boolean[]>
Parameters
privileges
string[]
Returns
Promise<boolean[]>
setPrivilegeState()
Sets the run-time privilege to a certain state for a specified package.staticsetPrivilegeState(packageId:string, privilege:string, state:SecurityManagerTypes.PrivilegeState):Promise<string>
Parameters
packageId
string
The packageId value of the specified package.
privilege
string
The run-time privilege to modify.
state
SecurityManagerTypes.PrivilegeState
State to set the run-time privilege to.
Returns
Promise<string>
Promise<string> On success, the promise is resolved. On error, the promise is
rejected with the error message: “Failed to set privilege state.”
setRuntimePrivilegeStates()
staticsetRuntimePrivilegeStates(credential:SecurityManagerTypes.ICredential, states:SecurityManagerTypes.IRuntimePrivilege[]):Promise<void>
Parameters
credential
SecurityManagerTypes.ICredential
states
SecurityManagerTypes.IRuntimePrivilege[]
Returns
Promise<void>
