SPI object representing a single Resource Provider.
Provides list of Resources (an abstract representation of resource invoked by Operations) which are provided by the relevant BOP. If they are not provided then the user will see 403 errors when the requested resources fail to pass the whitelist provide by this list of resources and enforced by the default authenticators.
The BOP does not need to provide this information if it is not making use of the ABCS default bop/js/api/operation/BOPAuthenticator methods and entity level role based security.
- Version:
- 17.1.1
- Source:
- See:
Example
define([
'bop/js/api/resource/Resource',
'bop/js/spi/resource/ResourceProvider'
], function (
Resource,
ResourceProvider
) {
var CustomResourceProvider = function () {
var parent = Resource.create({
id : 'employee_collection',
template : '/employee',
entity : 'my.custom.bop.Employee'
});
var child = Resource.createChild(parent, {
id : 'employee_instance',
template : '{id}',
});
this._resources = [parent, child];
};
CustomResourceProvider.prototype.getResources = function() {
return this._resources;
};
return CustomResourceProvider;
});
Methods
getResources() → {Array.<bop/js/api/resource/Resource>}
stable API
Gets the array of Resources provided by this ResourceProvider.
- Version:
- 17.1.1
- Source:
Returns:
- Type
- Array.<bop/js/api/resource/Resource>