public class User extends Item
Modifier and Type | Class and Description |
---|---|
static class |
User.accessFlag
ACL flags constants
|
static class |
User.dataFlag
Data flags constants
|
static class |
User.events |
static class |
User.logMessageAction
Such actions starts with "user_" and looks like "user_update_name" or "user_create_poi".
|
static class |
User.userFlag
User flags constants
|
Item.ItemType, Item.measureUnitsFlag, Item.measureUnitsType, Item.UpdateItemProperty
Constructor and Description |
---|
User() |
Modifier and Type | Method and Description |
---|---|
static long |
defaultDataFlags()
Fetch default current user flags
|
java.lang.String |
getHostsMask()
Hosts mask, restrict list of IP addresses from which user can access Wialon, wildcards supported
|
void |
getItemsAccess(boolean directAccess,
Item.ItemType itemSuperclass,
ResponseHandler callback)
Get ACL for this users over all items
|
void |
getLocale(ResponseHandler callback)
Get localization settings, remote call, require ACL bit wialon.item.Item.accessFlags.viewProperties over item
|
ItemProperties |
getMobileAppsPlugin() |
java.lang.Long |
getUserFlags()
User flags
|
void |
setHostsMask(java.lang.String hostsMask) |
void |
updateHostsMask(java.lang.String hostsMask,
ResponseHandler callback)
Update hosts mask, from which user can access Wialon, require ACL bit User.accessFlag.editUserFlags over user
|
void |
updateItemAccess(Item item,
long accessMask,
ResponseHandler callback)
Update this user access to some other, require ACL bit Item.accessFlag.setItemsAccess over user and Item.accessFlag.setAcl over item
|
boolean |
updateItemData(java.lang.String key,
com.google.gson.JsonElement data) |
void |
updateLocale(java.lang.String locale,
ResponseHandler callback)
Update this user localization settings
|
void |
updatePassword(java.lang.String oldPassword,
java.lang.String newPassword,
ResponseHandler callback)
Update password require ACL bit User.accessFlag.operateAs over user and correct oldPassword OR
User.accessFlag.editUserFlags and empty oldPassword
|
void |
updateUserFlags(long flags,
long flagsMask,
ResponseHandler callback)
Update this user flags, require ACL bit User.accessFlag.editUserFlags over user
|
addLogRecord, fireItemPropertyEvent, getAccountId, getAdminFieldsPlugin, getCreatorId, getCustomFieldsPlugin, getCustomProperty, getDataFlags, getId, getItemType, getMeasureUnits, getName, getOnUpdatePropertiesCallback, getUserAccess, handleMessage, onUpdateProperties, registerItemPropertyHandler, setDataFlags, updateCustomProperty, updateMeasureUnits, updateName
addListener, clearListeners, fireEvent, removeListener, removeListeners
public ItemProperties getMobileAppsPlugin()
public java.lang.Long getUserFlags()
public java.lang.String getHostsMask()
public void getItemsAccess(boolean directAccess, Item.ItemType itemSuperclass, ResponseHandler callback)
directAccess
- return only items with direct access for this useritemSuperclass
- item superclasscallback
- callback that will receive information about user ACL
result is object {itemId1: accessMask, itemId2: accessMask, ...}public void updateItemAccess(Item item, long accessMask, ResponseHandler callback)
item
- item which access need to be updatedaccessMask
- new item ACLcallback
- callback that will receive information about access update: callback(code), zero code is successpublic void updateUserFlags(long flags, long flagsMask, ResponseHandler callback)
flags
- flags which to set, see User.userFlag for possible values
canSendSMS and canCreateItems flags require all creators of this user to have them enabledflagsMask
- mask of which flags to set to ON/OFF. If mask contain invalid bits, request would be deniedcallback
- callback that will receive information about flags updatepublic void updateHostsMask(java.lang.String hostsMask, ResponseHandler callback)
hostsMask
- new wildcard-base hosts mask, use empty value to disable this restrictioncallback
- callback that will receive information about hosts mask updatepublic void getLocale(ResponseHandler callback)
callback
- callback that get result of server operation in form callback(code, result), where result represents JSON data for localization settingspublic void updateLocale(java.lang.String locale, ResponseHandler callback)
locale
- localization parameters, format: {fd: text, wd: ubyte}callback
- callback that will receive information about localization updatepublic void updatePassword(java.lang.String oldPassword, java.lang.String newPassword, ResponseHandler callback)
oldPassword
- old password if only User.accessFlag.operateAs acl bit availablenewPassword
- new passwordcallback
- callback that will receive information about password updatepublic boolean updateItemData(java.lang.String key, com.google.gson.JsonElement data)
updateItemData
in class Item
public void setHostsMask(java.lang.String hostsMask)
public static long defaultDataFlags()