Class: UserRoleMapper

UserRoleMapper

Represents a role to appuser mapping in your application on Built.io Backend. UserRoleMapperRoleMapper inherts from Object.

new UserRoleMapper(uid){UserRoleMapper}

user-role-mapper.js, line 7
Creates a role to appuser mapping
Name Type Description
uid String | Object The uid of this object on Built.io Backend or a json object with role_uid and user_uid properties.
Example
// 'blt5d4sample2633b' is a dummy Application API key
// app.UserRoleMapperRoleMapper() returns a 'UserRoleMapperRoleMapper' instance
// 'blt111sample2423b' is uid of an user on Built.io Backend
// 'blt222sample2423b' is uid of a role on Built.io Backend
var UserRoleMapper = Built.App('blt5d4sample2633b').UserRoleMapperRoleMapper; 
// Example demonstrating the constructor taking a user's uid as argument
var user = UserRoleMapper('blt111sample2423b');
// Example demonstrating the constructor taking a initial value
var user = UserRoleMapper({
   role_uid: 'blt222sample2423b',
   user_uid: 'blt111sample2423b'
});

Methods

getRoleUid(){String}

user-role-mapper.js, line 97
Gets value for user_uid
Example
// 'blt5d4sample2633b' is a dummy Application API key
// 'app.UserRoleMapper() returns a 'UserRoleMapper' instance
// 'blt111sample24a6b' is uid of a application user on object on Built.io Backend
var role 		= Built.App('blt5d4sample2633b').UserRoleMapper();
var userUid = role.getRoleUid();

getUserUid(){String}

user-role-mapper.js, line 79
Gets value for user_uid
Example
// 'blt5d4sample2633b' is a dummy Application API key
// 'app.UserRoleMapper() returns a 'UserRoleMapper' instance
// 'blt111sample24a6b' is uid of a application user on object on Built.io Backend
var role 		= Built.App('blt5d4sample2633b').UserRoleMapper();
var userUid = role.getUserUid();

setRoleUid(uid){UserRoleMapper}

user-role-mapper.js, line 43
Set a value for role_uid field
Name Type Description
uid String Uid of a existing role on Built.io Backend
Example
// 'blt5d4sample2633b' is a dummy Application API key
// 'app.UserRoleMapper() returns a 'UserRoleMapper' instance
// 'blt111sample24a6b' is uid of a role object on Built.io Backend
var role = Built.App('blt5d4sample2633b').UserRoleMapper();
role = role.setRoleUid('blt111sample24a6b');

setUserUid(uid){UserRoleMapper}

user-role-mapper.js, line 61
Set a value for user_uid field
Name Type Description
uid String Uid of a existing role on Built.io Backend
Example
// 'blt5d4sample2633b' is a dummy Application API key
// 'app.UserRoleMapper() returns a 'UserRoleMapper' instance
// 'blt111sample24a6b' is uid of a application user on object on Built.io Backend
var role = Built.App('blt5d4sample2633b').UserRoleMapper();
role = role.setUserUid('blt111sample24a6b');