new AclService(context, optionsopt)
BeNomad BeMap JavaScript API - AclService (v1.5)
Promise-based wrapper around the BeMap ACL endpoints. The primary entry
point is `getCurrentUserDetails()` which calls
`GET service/acl/1.0/user/details` and returns a typed
`bemap.AclDetailsResponse` carrying the user's username, granted roles,
accessible geoservers, and accessible charging-station providers.
**Why you want this in a customer app.** The geoserver list is filtered
server-side by the user's ACL — so this is the right way to populate a
"Geoserver" dropdown that only shows entries the user can actually use,
with the default one pre-selected. Calling against a different geoserver
key would return a 403 from the data services.
Typical use:
var acl = new bemap.AclService(ctx);
acl.getCurrentUserDetails().then(function(details) {
details.getGeoservers().forEach(function(gs) {
addOption(gs.getKey(), gs.getValue(), gs.isDefault());
});
});
Parameters:
| Name |
Type |
Attributes |
Description |
context |
bemap.Context
|
|
BeMap-JS-API Context. Mandatory. |
options |
Object
|
<optional>
|
|
- Since:
- Source:
Fetch the current authenticated user's ACL details.