IafNsProvider
Use the IafNsProvider API to manage namespace providers and their namespaces and resources on the platform.
addResourceByUserType#
Adds a resource with a userType you pass to a namespace provider.
| Parameter | Required | Type | Description |
|---|---|---|---|
| nsProvider | Yes | Object | Pass a UserGroup object. |
| resource | Yes | Object | Pass a Project object. |
| updateFunc | Yes | Function | Pass a JavaScript callback function with nsProvider and ctx as the parameters. |
| ctx | No | Ctx | Context, such as namespaces and authentication token information. |
addResourceHelper#
A helper function that links a namespace provider to resources. The userType is added as a property to the namespace provider's "_userAttributes" property and its value is the resource's id.
| Parameter | Required | Type | Description |
|---|---|---|---|
| nsProvider | Yes | Object | Pass a UserGroup object. |
| resource | Yes | Object | Pass a Project object. |
| propertyName | Yes | String | Pass a user type name. The user type is added as a property to the namespace provider's "_userAttributes" property and its value is the resource's id. |
| updateFunc | Yes | Function | Pass a JavaScript callback function with nsProvider and ctx as the parameters. |
| ctx | No | Ctx | Context, such as namespaces and authentication token information. |
getResourcesByUserType#
Gets resources, such as a project's Workspace or UserGroup, in a namespace provider that match the userType you pass.
| Parameter | Required | Type | Description |
|---|---|---|---|
| nsProvider | Yes | Object | Pass a UserGroup or Project object. |
| userType | Yes | String | Pass a user type for a project Workspace or UserGroup. |
| ctx | No | Ctx | Context, such as namespaces and authentication token information. |
Object - Returns a UserGroup or Project object that matches the user type you pass.
purgeNamespaceContents#
Purges a namespace's contents.
| Parameter | Required | Type | Description |
|---|---|---|---|
| nsProvider | Yes | Object | Pass a Project object. |
| ctx | No | Ctx | Context, such as namespaces and authentication token information. |
Void -
removeResourceByUserType#
Removes a resource with the userType you pass from a namespace provider.
| Parameter | Required | Type | Description |
|---|---|---|---|
| nsProvider | Yes | Object | Pass a UserGroup object. |
| resource | Yes | Object | Pass a Project object. |
| updateFunc | Yes | Function | Pass a JavaScript callback function with nsProvider and ctx as the parameters. |
| ctx | No | Ctx | Context, such as namespaces and authentication token information. |
removeResourceHelper#
A helper function that removes a project from a name space provider. The user type is added as a property to the namespace provider's "_userAttributes" property and its value is the resource's id.
| Parameter | Required | Type | Description |
|---|---|---|---|
| nsProvider | Yes | Object | Pass a UserGroup object. |
| resource | Yes | Object | Pass a Project object. |
| propertyName | Yes | String | Pass a user type name. The user type is added as a property to the namespace provider's "_userAttributes" property and its value is the resource's id. |
| updateFunc | Yes | Function | Pass a JavaScript callback function with nsProvider and ctx as the parameters. |
| ctx | No | Ctx | Context, such as namespaces and authentication token information. |