UNPKG

baasic-sdk-javascript

Version:

JavaScript SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).

139 lines (138 loc) 6.39 kB
import { BaseRoute } from '../../common'; import { IAppOptions } from '../../core/contracts'; import { IAccessPolicy } from './contracts'; export declare class PermissionRoute extends BaseRoute { protected appOptions: IAppOptions; /** * Find all route with route and query parameters. */ findAllRoute: string; /** * Find route with route and query parameters. **/ findRoute: string; /** * sectionsPolicies route and query parameters. */ sectionsPoliciesRoute: string; /** * Get actions route with route and query parameters. **/ getActionsRoute: string; /** * Get roles route with route and query parameters. **/ getRolesRoute: string; /** * Get users route with route and query parameters. **/ getUsersRoute: string; /** * Create route with route and query parameters. **/ createRoute: string; /** * Remove route with route and query parameters. **/ removeRoute: string; constructor(appOptions: IAppOptions); /** * Parses find all route which can be expanded with additional options. Supported items are: * - `searchQuery` - A string value used to identify access policy resources using the phrase search. * - `sort` - A string used to set the access policy property to sort the result collection by. * @method * @example permissionRoute.findAll( {searchQuery: '<search-phrase>'} ); **/ findAll(options?: any): any; /** * Parses find route which can be expanded with additional options. Supported items are: * - `section` - Section abbreviation which identifies part of the application for which security privileges can be retrieved and managed. * - `searchQuery` - A string value used to identify access policy resources using the phrase search. * - `sort` - A string used to set the access policy property to sort the result collection by. * @method * @example permissionRoute.find( 'sectionName', {searchQuery: '<search-phrase>'} ); **/ find(section: string, options?: any): any; /** * Parses getActions route which can be expanded with additional options. Supported items are: * - `searchQuery` - A string value used to identify access action resources using the phrase search. * - `sort` - A string used to set the access action property to sort the result collection by. * @method * @example permissionRoute.getActions( {searchQuery: '<search-phrase>'} ); **/ getActions(options?: any): any; /** * Parses getRoles route which can be expanded with additional options. Supported items are: * - `searchQuery` - A string value used to identify access policy resources using the phrase search. * - `sort` - A string used to set the access policy property to sort the result collection by. * - `page` - A value used to set the page number, i.e. to retrieve certain access policy subset from the storage. * - `rpp` - A value used to limit the size of result set per page. * @method * @example permissionRoute.getRoles( {searchQuery: '<search-phrase>'} ); **/ getRoles(options?: any): any; /** * Parses getUsers route which can be expanded with additional options. Supported items are: * - `searchQuery` - A string value used to identify access policy resources using the phrase search. * - `sort` - A string used to set the access policy property to sort the result collection by. * - `page` - A value used to set the page number, i.e. to retrieve certain access policy subset from the storage. * - `rpp` - A value used to limit the size of result set per page. * @method * @example permissionRoute.getRoles( {searchQuery: '<search-phrase>'} ); **/ getUsers(options?: any): any; /** * Parses sectionsPoliciesRoute which can be expanded with additional options. * - `searchQuery` - A string value used to identify access policy resources using the phrase search. * - `sort` - A string used to set the access policy property to sort the result collection by. * - `page` - A value used to set the page number, i.e. to retrieve certain access policy subset from the storage. * - `rpp` - A value used to limit the size of result set per page. * - `section` - Section abbreviation which identifies part of the application for which security privileges can be retrieved and managed. * @param {string} sections - Comma-spearated list of section abbreviations that identify parts of the application for which security privileges can be retrieved and managed. */ findSectionsPolicies(sectionAbrvs: string, options?: any): any; /** * Parses create permission route; this URI template doesn't expose any additional properties. * @method * @example permissionRoute.create({}); **/ create(): any; /** * Returns a promise that is resolved once the remove permission action has been performed. This action will remove a permission from the system, if completed successfully. * @param data A permission object used to delete specified permission resource. * @returns A promise that is resolved once the remove action has been performed. * @method * @example // Permission is a resource previously fetched using get action. permissionClient.remove(permission) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ remove(data: IAccessPolicy): any; } /** * @overview ***Notes:** - Refer to the [Baasic REST API](http://dev.baasic.com/api/reference/home) for detailed information about available Baasic REST API end-points. - [URI Template](https://github.com/Baasic/uritemplate-js) syntax enables expanding the Baasic route templates to Baasic REST URIs providing it with an object that contains URI parameters. - All end-point objects are transformed by the associated route definition. */