Fetch the userInfo once loggedIn and expose the capability of admin (#7682)

* Fetch the userInfo once loggedIn and expose the cabilibility of admin

* Rollback method

* Return same use if defined

* Use the same pepleContent service for UserInfoCOmpnent

* Remove useless import

* Use interface

* Use angular resolver instead of guard

* Remove fdescribe

* Fix linting

* Regenerate doc

* Improve doc

* Fix optional

* Fix the unit test

* Fix comment

* Fix lint

* Fix unit

* Add fetch user as part of the ssoGuard

* Fix unit test after fetch

* Add additional unit

* Fix await
This commit is contained in:
Maurizio Vitale
2022-06-27 12:02:01 +01:00
committed by GitHub
parent a30de37a02
commit 28a47e83d2
49 changed files with 378 additions and 332 deletions

View File

@@ -30,6 +30,10 @@ Supports app configuration settings, stored server side.
- **load**(): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<any>`<br/>
Loads the config file.
- **Returns** [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<any>` - Notification when loading is complete
- **loadWellKnown**(hostIdp: `string`): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<`[`OpenidConfiguration`](../../../lib/core/services/openid-configuration.interface.ts)`>`<br/>
Call the discovery API to fetch configuration
- _hostIdp:_ `string` -
- **Returns** [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<`[`OpenidConfiguration`](../../../lib/core/services/openid-configuration.interface.ts)`>` - Discovery configuration
- **select**(property: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
Requests notification of a property value when it is loaded.
- _property:_ `string` - The desired property value

View File

@@ -13,20 +13,20 @@ Maps type names to field component types for the [Card View component](../compon
### Methods
- **getComponentTypeResolver**(type: `string`, defaultValue: `Type<__type>` = `this.defaultValue`): [`DynamicComponentResolveFunction`](../../../lib/core/services/dynamic-component-mapper.service.ts)<br/>
- **getComponentTypeResolver**(type: `string`, defaultValue: `Type<any>` = `this.defaultValue`): [`DynamicComponentResolveFunction`](../../../lib/core/services/dynamic-component-mapper.service.ts)<br/>
Gets the currently active [DynamicComponentResolveFunction](../../../lib/core/services/dynamic-component-mapper.service.ts) for a field type.
- _type:_ `string` - The type whose resolver you want
- _defaultValue:_ `Type<__type>` - Default type returned for types that are not yet mapped
- _defaultValue:_ `Type<any>` - Default type returned for types that are not yet mapped
- **Returns** [`DynamicComponentResolveFunction`](../../../lib/core/services/dynamic-component-mapper.service.ts) - Resolver function
- **register**(components: `Function`, override: `boolean` = `false`)<br/>
Register multiple components
- _components:_ `Function` -
- _override:_ `boolean` -
- **resolveComponentType**(model: [`DynamicComponentModel`](../../../lib/core/services/dynamic-component-mapper.service.ts), defaultValue: `Type<__type>` = `this.defaultValue`): `Type<__type>`<br/>
- **resolveComponentType**(model: [`DynamicComponentModel`](../../../lib/core/services/dynamic-component-mapper.service.ts), defaultValue: `Type<any>` = `this.defaultValue`): `Type<any>`<br/>
Finds the component type that is needed to render a form field.
- _model:_ [`DynamicComponentModel`](../../../lib/core/services/dynamic-component-mapper.service.ts) - [Form](../../../lib/process-services/src/lib/task-list/models/form.model.ts) field model for the field to render
- _defaultValue:_ `Type<__type>` - Default type returned for field types that are not yet mapped.
- **Returns** `Type<__type>` - Component type
- _defaultValue:_ `Type<any>` - Default type returned for field types that are not yet mapped.
- **Returns** `Type<any>` - Component type
- **setComponentTypeResolver**(type: `string`, resolver: [`DynamicComponentResolveFunction`](../../../lib/core/services/dynamic-component-mapper.service.ts), override: `boolean` = `true`)<br/>
Sets or optionally replaces a [DynamicComponentResolveFunction](../../../lib/core/services/dynamic-component-mapper.service.ts) for a field type.
- _type:_ `string` - The type whose resolver you want to set

View File

@@ -13,9 +13,9 @@ Gets a list of Content Services nodes currently in the trash.
### Methods
- **getDeletedNodes**(options?: `Object`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/NodePaging.md)`>`<br/>
- **getDeletedNodes**(options?: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/NodePaging.md)`>`<br/>
Gets a list of nodes in the trash.
- _options:_ `Object` - (Optional) Options for JS-API call
- _options:_ `any` - (Optional) Options for JS-API call
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/NodePaging.md)`>` - List of nodes in the trash
## Details

View File

@@ -20,9 +20,9 @@ Gets version and license information for Process Services and Content Services.
- **getBpmProductInfo**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`BpmProductVersionModel`](../../../lib/core/models/product-version.model.ts)`>`<br/>
Gets product information for Process Services.
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`BpmProductVersionModel`](../../../lib/core/models/product-version.model.ts)`>` - ProductVersionModel containing product details
- **getEcmProductInfo**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`RepositoryInfo`](../../../lib/cli/node_modules/@alfresco/js-api/src/api/discovery-rest-api/model/repositoryInfo.ts)`>`<br/>
- **getEcmProductInfo**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<RepositoryInfo>`<br/>
Gets product information for Content Services.
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`RepositoryInfo`](../../../lib/cli/node_modules/@alfresco/js-api/src/api/discovery-rest-api/model/repositoryInfo.ts)`>` - ProductVersionModel containing product details
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<RepositoryInfo>` - ProductVersionModel containing product details
## Details

View File

@@ -23,9 +23,9 @@ Gets a list of items a user has marked as their favorites.
- _entries:_ `any[]` -
- **Returns** `any[]` -
- **remapFavoritesData**(data: [`FavoritePaging`](../../../lib/cli/node_modules/@alfresco/js-api/src/api/content-rest-api/model/favoritePaging.ts) = `{}`): [`NodePaging`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/NodePaging.md)<br/>
- **remapFavoritesData**(data: `FavoritePaging` = `{}`): [`NodePaging`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/NodePaging.md)<br/>
- _data:_ [`FavoritePaging`](../../../lib/cli/node_modules/@alfresco/js-api/src/api/content-rest-api/model/favoritePaging.ts) -
- _data:_ `FavoritePaging` -
- **Returns** [`NodePaging`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/NodePaging.md) -
- **remapEntry**(\_\_namedParameters: `Function`): `any`<br/>

View File

@@ -13,20 +13,20 @@ Maps a form field type string onto the corresponding form [widget component](../
### Methods
- **getComponentTypeResolver**(type: `string`, defaultValue: `Type<__type>` = `this.defaultValue`): [`DynamicComponentResolveFunction`](../../../lib/core/services/dynamic-component-mapper.service.ts)<br/>
- **getComponentTypeResolver**(type: `string`, defaultValue: `Type<any>` = `this.defaultValue`): [`DynamicComponentResolveFunction`](../../../lib/core/services/dynamic-component-mapper.service.ts)<br/>
Gets the currently active [DynamicComponentResolveFunction](../../../lib/core/services/dynamic-component-mapper.service.ts) for a field type.
- _type:_ `string` - The type whose resolver you want
- _defaultValue:_ `Type<__type>` - Default type returned for types that are not yet mapped
- _defaultValue:_ `Type<any>` - Default type returned for types that are not yet mapped
- **Returns** [`DynamicComponentResolveFunction`](../../../lib/core/services/dynamic-component-mapper.service.ts) - Resolver function
- **register**(components: `Function`, override: `boolean` = `false`)<br/>
Register multiple components
- _components:_ `Function` -
- _override:_ `boolean` -
- **resolveComponentType**(model: [`DynamicComponentModel`](../../../lib/core/services/dynamic-component-mapper.service.ts), defaultValue: `Type<__type>` = `this.defaultValue`): `Type<__type>`<br/>
- **resolveComponentType**(model: [`DynamicComponentModel`](../../../lib/core/services/dynamic-component-mapper.service.ts), defaultValue: `Type<any>` = `this.defaultValue`): `Type<any>`<br/>
Finds the component type that is needed to render a form field.
- _model:_ [`DynamicComponentModel`](../../../lib/core/services/dynamic-component-mapper.service.ts) - [Form](../../../lib/process-services/src/lib/task-list/models/form.model.ts) field model for the field to render
- _defaultValue:_ `Type<__type>` - Default type returned for field types that are not yet mapped.
- **Returns** `Type<__type>` - Component type
- _defaultValue:_ `Type<any>` - Default type returned for field types that are not yet mapped.
- **Returns** `Type<any>` - Component type
- **setComponentTypeResolver**(type: `string`, resolver: [`DynamicComponentResolveFunction`](../../../lib/core/services/dynamic-component-mapper.service.ts), override: `boolean` = `true`)<br/>
Sets or optionally replaces a [DynamicComponentResolveFunction](../../../lib/core/services/dynamic-component-mapper.service.ts) for a field type.
- _type:_ `string` - The type whose resolver you want to set

View File

@@ -13,10 +13,10 @@ Decodes a JSON Web Token (JWT) to a JavaScript object.
### Methods
- **decodeToken**(token: `any`): `Object`<br/>
- **decodeToken**(token: `any`): `any`<br/>
Decodes a JSON web token into a JS object.
- _token:_ `any` - Token in encoded form
- **Returns** `Object` - Decoded token data object
- **Returns** `any` - Decoded token data object
- **getAccessToken**(): `string`<br/>
Gets access token
- **Returns** `string` - access token

View File

@@ -18,25 +18,30 @@ Gets information about a Content Services user.
- _newPerson:_ [`PersonBodyCreate`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/model/personBodyCreate.ts) - Object containing the new person details.
- _opts:_ `any` - (Optional) Optional parameters
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`EcmUserModel`](../../core/models/ecm-user.model.md)`>` - Created new person
- **getCurrentPerson**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
Gets information about the user who is currently logged in.
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - User information
- **getPerson**(personId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
- **getCurrentUserInfo**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`EcmUserModel`](../../core/models/ecm-user.model.md)`>`<br/>
Gets information about the current user alias -me-
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`EcmUserModel`](../../core/models/ecm-user.model.md)`>` - User information
- **getPerson**(personId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`EcmUserModel`](../../core/models/ecm-user.model.md)`>`<br/>
Gets information about a user identified by their username.
- _personId:_ `string` - ID of the target user
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - User information
- **isContentAdmin**(): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<boolean>`<br/>
- **Returns** [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<boolean>` -
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`EcmUserModel`](../../core/models/ecm-user.model.md)`>` - User information
- **getUserProfileImage**(avatarId: `string`): `string`<br/>
Returns a profile image as a URL.
- _avatarId:_ `string` - Target avatar
- **Returns** `string` - Image URL
- **isCurrentUserAdmin**(): `boolean`<br/>
Used to know if the current user has the admin capability
- **Returns** `boolean` - true or false
- **listPeople**(requestQuery?: [`PeopleContentQueryRequestModel`](../../../lib/core/services/people-content.service.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`PeopleContentQueryResponse`](../../../lib/core/services/people-content.service.ts)`>`<br/>
Gets a list of people.
- _requestQuery:_ [`PeopleContentQueryRequestModel`](../../../lib/core/services/people-content.service.ts) - (Optional) maxItems and skipCount parameters supported by JS-API
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`PeopleContentQueryResponse`](../../../lib/core/services/people-content.service.ts)`>` - Response containing pagination and list of entries
- **updatePerson**(personId: `string`, details: [`PersonBodyUpdate`](../../../lib/cli/node_modules/@alfresco/js-api/src/api/content-rest-api/model/personBodyUpdate.ts), opts?: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`EcmUserModel`](../../core/models/ecm-user.model.md)`>`<br/>
- **resetLocalCurrentUser**()<br/>
Reset the local current user object
- **updatePerson**(personId: `string`, details: `PersonBodyUpdate`, opts?: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`EcmUserModel`](../../core/models/ecm-user.model.md)`>`<br/>
Updates the person details
- _personId:_ `string` - The identifier of a person
- _details:_ [`PersonBodyUpdate`](../../../lib/cli/node_modules/@alfresco/js-api/src/api/content-rest-api/model/personBodyUpdate.ts) - The person details
- _details:_ `PersonBodyUpdate` - The person details
- _opts:_ `any` - (Optional) Optional parameters
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`EcmUserModel`](../../core/models/ecm-user.model.md)`>` - Updated person model

View File

@@ -20,11 +20,11 @@ Manages prearranged conversions of content to different formats.
- _pollingInterval:_ `number` - Time interval (in milliseconds) between checks for completion
- _retries:_ `number` - Number of attempts to make before declaring failure
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`RenditionEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/RenditionEntry.md)`>` - True if the rendition was created, false otherwise
- **createRendition**(nodeId: `string`, encoding: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<__type>`<br/>
- **createRendition**(nodeId: `string`, encoding: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
Creates a rendition for a node.
- _nodeId:_ `string` - ID of the target node
- _encoding:_ `string` - Name of the rendition encoding
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<__type>` - Null response to indicate completion
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Null response to indicate completion
- **generateRenditionForNode**(nodeId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
Generates a rendition for a node using the first available encoding.
- _nodeId:_ `string` - ID of the target node

View File

@@ -19,9 +19,9 @@ Accesses and manipulates sites from a Content Services repository.
- _inviteeId:_ `string` - The invitee user name.
- _opts:_ `any` - (Optional) Options supported by JS-API
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteMembershipRequestWithPersonPaging`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/SiteMembershipRequestWithPersonPaging.md)`>` - Null response notifying when the operation is complete
- **createSite**(siteBody: [`SiteBodyCreate`](../../../lib/cli/node_modules/@alfresco/js-api/src/api/content-rest-api/model/siteBodyCreate.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`>`<br/>
- **createSite**(siteBody: `SiteBodyCreate`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`>`<br/>
Create a site
- _siteBody:_ [`SiteBodyCreate`](../../../lib/cli/node_modules/@alfresco/js-api/src/api/content-rest-api/model/siteBodyCreate.ts) - [SiteBodyCreate](../../../lib/cli/node_modules/@alfresco/js-api/src/api/content-rest-api/model/siteBodyCreate.ts) to create site
- _siteBody:_ `SiteBodyCreate` - SiteBodyCreate to create site
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`>` - site SiteEntry
- **createSiteGroupMembership**(siteId: `string`, siteMembershipBodyCreate: [`SiteMembershipBodyCreate`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/SiteMembershipBodyCreate.md)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteGroupEntry`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/SiteGroupEntry.md)`>`<br/>
Create a site membership for group
@@ -52,24 +52,24 @@ Accesses and manipulates sites from a Content Services repository.
- **getEcmCurrentLoggedUserName**(): `string`<br/>
Gets the username of the user currently logged into ACS.
- **Returns** `string` - Username string
- **getSite**(siteId: `string`, opts?: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`|__type>`<br/>
- **getSite**(siteId: `string`, opts?: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`|any>`<br/>
Gets the details for a site.
- _siteId:_ `string` - ID of the target site
- _opts:_ `any` - (Optional) Options supported by JS-API
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`|__type>` - Information about the site
- **getSiteContent**(siteId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`|__type>`<br/>
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`|any>` - Information about the site
- **getSiteContent**(siteId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`|any>`<br/>
Gets a site's content.
- _siteId:_ `string` - ID of the target site
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`|__type>` - Site content
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`|any>` - Site content
- **getSiteGroupMembership**(siteId: `string`, groupId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteGroupEntry`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/SiteGroupEntry.md)`>`<br/>
Get information about site membership of group
- _siteId:_ `string` - The identifier of a site.
- _groupId:_ `string` - The authorityId of a group.
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteGroupEntry`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/SiteGroupEntry.md)`>` - [Observable](http://reactivex.io/documentation/observable.html)&lt;SiteGroupEntry>
- **getSiteMembers**(siteId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`|__type>`<br/>
- **getSiteMembers**(siteId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`|any>`<br/>
Gets a list of all a site's members.
- _siteId:_ `string` - ID of the target site
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`|__type>` - Site members
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`|any>` - Site members
- **getSiteMembershipRequests**(opts?: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteMembershipRequestWithPersonPaging`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/SiteMembershipRequestWithPersonPaging.md)`>`<br/>
Gets a list of site membership requests.
- _opts:_ `any` - (Optional) Options supported by JS-API
@@ -82,11 +82,11 @@ Accesses and manipulates sites from a Content Services repository.
Gets a list of all sites in the repository.
- _opts:_ `any` - Options supported by JS-API
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SitePaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitePaging.md)`>` - List of sites
- **listSiteGroups**(siteId: `string`, opts?: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteGroupPaging`](../../../lib/cli/node_modules/@alfresco/js-api/src/api/content-rest-api/model/siteGroupPaging.ts)`>`<br/>
- **listSiteGroups**(siteId: `string`, opts?: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<SiteGroupPaging>`<br/>
List group membership for site
- _siteId:_ `string` - The identifier of a site.
- _opts:_ `any` - (Optional) Options supported by JS-API
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteGroupPaging`](../../../lib/cli/node_modules/@alfresco/js-api/src/api/content-rest-api/model/siteGroupPaging.ts)`>` - [Observable](http://reactivex.io/documentation/observable.html)&lt;SiteGroupPaging>
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<SiteGroupPaging>` - [`Observable`](http://reactivex.io/documentation/observable.html)&lt;SiteGroupPaging>
- **listSiteMemberships**(siteId: `string`, opts: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`SiteMemberPaging`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/SiteMemberPaging.md)`>`<br/>
Gets a list of all a site's members.
- _siteId:_ `string` - ID of the target site

View File

@@ -17,15 +17,15 @@ Supports localisation.
Adds a new folder of translation source files.
- _name:_ `string` - Name for the translation provider
- _path:_ `string` - Path to the folder
- **get**(key: `string|Array<string>`, interpolateParams?: `Object`): [`Observable`](http://reactivex.io/documentation/observable.html)`<string|any>`<br/>
- **get**(key: `string|Array<string>`, interpolateParams?: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<string|any>`<br/>
Gets the translation for the supplied key.
- _key:_ `string|Array<string>` - Key to translate
- _interpolateParams:_ `Object` - (Optional) String(s) to be interpolated into the main message
- _interpolateParams:_ `any` - (Optional) String(s) to be interpolated into the main message
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<string|any>` - Translated text
- **instant**(key: `string|Array<string>`, interpolateParams?: `Object`): `string|any`<br/>
- **instant**(key: `string|Array<string>`, interpolateParams?: `any`): `string|any`<br/>
Directly returns the translation for the supplied key.
- _key:_ `string|Array<string>` - Key to translate
- _interpolateParams:_ `Object` - (Optional) String(s) to be interpolated into the main message
- _interpolateParams:_ `any` - (Optional) String(s) to be interpolated into the main message
- **Returns** `string|any` - Translated text
- **loadTranslation**(lang: `string`, fallback?: `string`)<br/>
Loads a translation file.

View File

@@ -20,11 +20,16 @@ Provides access to various APIs related to file upload features.
- **cancelUpload**(files: [`FileModel`](../../../lib/core/models/file.model.ts)`[]`)<br/>
Cancels uploading of files. If the file is smaller than 1 MB the file will be uploaded and then the node deleted to prevent having files that were aborted but still uploaded.
- _files:_ [`FileModel`](../../../lib/core/models/file.model.ts)`[]` - One or more separate parameters or an array of files specifying uploads to cancel
- **clearCache**()<br/>
- **clearQueue**()<br/>
Clears the upload queue
- **getQueue**(): [`FileModel`](../../../lib/core/models/file.model.ts)`[]`<br/>
Gets the file Queue
- **Returns** [`FileModel`](../../../lib/core/models/file.model.ts)`[]` - Array of files that form the queue
- **getThreadsCount**(): `number`<br/>
Returns the number of concurrent threads for uploading.
- **Returns** `number` - Number of concurrent threads (default 1)
- **getUploadPromise**(file: [`FileModel`](../../../lib/core/models/file.model.ts)): `any`<br/>
Gets an upload promise for a file.
- _file:_ [`FileModel`](../../../lib/core/models/file.model.ts) - The target file
@@ -122,7 +127,7 @@ It is also possible to provide the `versioningEnabled` value as part of the [`Fi
### Concurrent Uploads
By default, the Upload Service processes one file at a time.
By default, the [Upload Service](../../core/services/upload.service.md) processes one file at a time.
You can increase the number of concurrent threads by changing the `upload.threads` configuration parameter:
**app.config.json**

View File

@@ -12,16 +12,18 @@ Checks the global and application access of a user
## Class members
### Methods
- **fetchUserAccess**()<br/>
Fetches the global and application access of the user
- **hasApplicationAccess**(appName: `string`, rolesToCheck: string[]): `boolean`<br/>
Checks if the user has at least one of the roles to check for a given app.
- appName: `string` - The name of the app
- rolesToCheck: `string[]` - The roles to check
- **Returns** `boolean` - True if it contains at least one of the given roles to check for the given app, false otherwise
- **hasGlobalAccess**(rolesToCheck: string[]): `boolean`<br/>
Checks if the user has at least one of the given roles to check in the global roles.
- rolesToCheck: `string[]` - The roles to check
- **Returns** `boolean` - True if it contains at least one of the given roles to check, false otherwise
- **resetAccess**() <br>
Resets the cached access of the user
- **fetchUserAccess**(): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<void>`<br/>
Fetches the global and application access of the user
- **Returns** [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<void>` -
- **hasApplicationAccess**(appName: `string`, rolesToCheck: `string[]`): `boolean`<br/>
Checks for global roles access.
- _appName:_ `string` - The app name
- _rolesToCheck:_ `string[]` - List of the roles to check
- **Returns** `boolean` - True if it contains at least one of the given roles, false otherwise
- **hasGlobalAccess**(rolesToCheck: `string[]`): `boolean`<br/>
Checks for global roles access.
- _rolesToCheck:_ `string[]` - List of the roles to check
- **Returns** `boolean` - True if it contains at least one of the given roles, false otherwise
- **resetAccess**()<br/>
Resets the cached user access