AV.User API

AV.User.locale

Current user locale

1
AV.User.locale;  // 'en';

You can also use User Settings API to get the locale

AV.User.name

Login user name

AV.User.isAdministrator

True if user has administrator permissions

AV.User.checkEntitlement

Check entitlements for the current user context

1
AV.User.checkEntitlement(entitlementsName);

Parameters:

  • entitlementsName {String|Array} - Entitlement name(s).
1
2
3
4
5
6
7
8
9
10
AV.User.checkEntitlement('ent_mcs_app_browse').then((result) => {
// result = true|false;
});

AV.User.checkEntitlement(['ent_mcs_app_browse', 'ent_mcs_app_edit']).then((result) => {
//result = {
// 'ent_mcs_app_browse': true|false
// 'ent_mcs_app_edit': true|false
//};
});

In case of an unsuccessful request, the method returns false value or an object with false values.

All data is cached on client side. If the backend list of entitlements has changed, you need to refresh the browser page.