Class UserList
Class defined in:src/node-userlist.js:75
Handles users and storage to database as well as user roles and permissions
addNewUser
( name, email, properties
)
src/node-userlist.js:404
Store a new user in the database
Parameters:object with the user token, user object, and an error message if the user could not be added
createUid
( name, email
)
src/node-userlist.js:44
Creates an uid.
Parameters:-
name
<String>The name
-
email
<> The email
the uid string
defineRolePermissions
( role, permissions
)
src/node-userlist.js:202
Set permissions for this role
Parameters:delete
( path
)
src/node-userlist.js:386
Wrapper for JsonDB.delete() Remove data at a path or log an error if it fails
Parameters:-
path
<String>
true if delete succeeds
editUser
( uid, properties
)
src/node-userlist.js:511
Edit user properties
Parameters:true if edit succeeds
getData
( path
)
src/node-userlist.js:340
Wrapper for JsonDB.getData() Retrieve data from json database or log an error if it fails
Parameters:-
path
<String>
object with the success flag and the retrieved data
getProperty
( uid, arguments
)
src/node-userlist.js:530
Get properties of a user
Parameters:the property or an array of properties
getUser
( name, email
)
src/node-userlist.js:444
Retrieve a user in the database by name and email
Parameters:object with the user token, user object, and an error message if the user could not be added
getUserById
( uid
)
src/node-userlist.js:474
Retrieve a user in the database by user id
Parameters:-
uid
<String>
object with the user token, user object, and an error message if the user could not be added
grantPermission
( role, action
)
src/node-userlist.js:226
Add permission for this action to the role
Parameters:initRolesAndPermissions
( rbac
)
src/node-userlist.js:180
Initialize role access system
Parameters:-
rbac
<Object>object containing the three parameters:
- roles: an array of strings of role names
- actions: an array of strings of action names
- permissions: an object of role-bitfield pairs
isAllowed
( ip, action
)
src/node-userlist.js:295
Check if user has permission to do an action
Parameters:true if user is permitted to perform this action
push
( path, data, checkIfPathExists
)
src/node-userlist.js:363
Wrapper for JsonDB.push() Push data to json database or log an error if it fails
Parameters:-
path
<String> -
data
<Object>new data to be pushed
-
checkIfPathExists
<Boolean>check if path exists before pushing * the data; default is false
true if push succeeds
removeRole
( ip, role
)
src/node-userlist.js:279
Remove this role from the list of user's roles
Parameters:removeUser
( uid
)
src/node-userlist.js:499
Remove user from the database
Parameters:-
uid
<String>
true if delete succeeds
revokePermission
( role, action
)
src/node-userlist.js:239
Remove permission for this action from the role
Parameters:track
( ip, user
)
src/node-userlist.js:131
Track user locally by ip
Parameters:name of the user