core/common/tenant-ui.service.ts
The helper UI service for tenant related methods built upon client services.
constructor(userService: UserService, appStateService: AppStateService)
|
|||||||||
Parameters :
|
canReadTenants |
canReadTenants()
|
Checks whether the current user has read access to tenants, i.e.:
Returns :
boolean
True, if the current user has read access to tenants. |
getCurrentTenantPreferredLoginOption |
getCurrentTenantPreferredLoginOption()
|
Returns current tenant preferred login mode.
Returns :
ITenantLoginOption
|
getCurrentUserLoginMode |
getCurrentUserLoginMode()
|
Returns current user login mode.
Returns :
TenantLoginOptionType
|
getOauth2Option | ||||||||
getOauth2Option(loginOptions: ITenantLoginOption[])
|
||||||||
Returns Oauth2 login option if it can be used by UI. Example Example :
Parameters :
Returns :
ITenantLoginOption
Returns ITenantLoginOption. Example Example :
|
getPreferredLoginOption | ||||||||
getPreferredLoginOption(loginOptions: ITenantLoginOption[])
|
||||||||
Returns tenant login option which is preferred. Example Example :
Parameters :
Returns :
ITenantLoginOption
Returns ITenantLoginOption. Example Example :
|
getSubscribedMicroservicesInCurrentTenant |
getSubscribedMicroservicesInCurrentTenant()
|
Gets all application of type MICROSERVICE subscribed to the current tenant. It checks the application references of the currentTenant from the application state. No additional request.
Returns :
IApplication[]
|
isBasic | ||||||||
isBasic(loginOption: ITenantLoginOption)
|
||||||||
Callback which checks if login option type is 'BASIC'. Example Example :
Parameters :
Returns :
boolean
|
Async isEnterpriseTenant |
isEnterpriseTenant()
|
Checks whether current tenant is an enterprise tenant. An enterprise tenant is a tenant which has subscribed:
See https://cumulocity.com/guides/users-guide/enterprise-edition/ for details about such tenants.
Returns :
Promise<boolean>
True, if current tenant is an enterprise tenant. |
Async isManagementTenant |
isManagementTenant()
|
Checks whether current tenant is the management tenant.
Returns :
Promise<boolean>
True if current tenant is the management tenant. |
isMicroserviceSubscribedInCurrentTenant | ||||||||
isMicroserviceSubscribedInCurrentTenant(identifier: string)
|
||||||||
Checks if application of type MICROSERVICE is subscribed to the current tenant. It checks the application references of the currentTenant from the application state. No additional request.
Parameters :
Returns :
boolean
|
isOauth2 | ||||||||
isOauth2(loginOption: ITenantLoginOption)
|
||||||||
Callback which checks if login option type is 'OAUTH2' and grantType is 'AUTHORIZATION_CODE'. Example Example :
Parameters :
Returns :
boolean
|
isOauthInternal | ||||||||
isOauthInternal(loginOption: ITenantLoginOption)
|
||||||||
Callback which checks if login option type is 'OAUTH2_INTERNAL'. Example Example :
Parameters :
Returns :
boolean
|
isVisibleOnLoginPage | ||||||||
isVisibleOnLoginPage(loginOption: ITenantLoginOption)
|
||||||||
Callback which checks if login option is visible on login page. Example Example :
Parameters :
Returns :
boolean
|
Readonly MANAGEMENT |
Type : string
|
Default value : 'management'
|
Readonly ROLE_TENANT_MANAGEMENT_READ |
Default value : Permissions.ROLE_TENANT_MANAGEMENT_READ
|
currentTenant |
getcurrentTenant()
|
Returns current tenant
Returns :
ICurrentTenant
|