Create a user account
- Open a command prompt in the tools subfolder of the <faircom> installation folder.
- Run the following command in the command line, replacing user1 with your desired username and password1 with your desired password (see the sa_admin utility for more options):
sa_admin -aADMIN -pADMIN -sFAIRCOMS -oua user1 -w password1
See the sa_admin utility for more options.
- Run the command.
Create an account in the ADMIN group
- Run the following to create a new account:
{
"api": "admin",
"action": "createAccount",
"params": {
"username": "ADMIN2",
"password": "ADMINADMINADMINADMIN"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}- Run the following to assign the ADMIN role to the newly created account:
{
"api": "admin",
"action": "assignRolesToAccounts",
"params": {
"add": [
{
"roleNames": [
"ADMIN"
],
"usernames": [
"ADMIN2"
]
}
]
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}- Run the following in command prompt to grant permissions in SQL:
GRANT ALL PRIVILEGES ON mqtt_client TO ADMIN2; GRANT ALL PRIVILEGES ON mqtt_client_history TO ADMIN2; GRANT ALL PRIVILEGES ON mqtt_topic TO ADMIN2; GRANT ALL PRIVILEGES ON mqtt_subscription_history TO ADMIN2; COMMIT WORK;
Grant rights to an integration table
Warning
Do NOT grant alter or delete rights, because integration tables must only be created and deleted through API actions such as "createIntegrationTable" and "deleteIntegrationTable".
- Click the SQL Scripts tab (
). - Paste the following script into the textbox to allow the specified user to read (select) and insert records into the specified table.
Tip
To only grant read rights, only grant the
selectright.
grant select on admin.table1 to user1; grant insert on admin.table1 to user1; commit;
Change table1 to a new integration table name of your choice.
Change user1 to a username of your choice.
Caution
Use this sample grant update command only if you want to allow an account to modify collected data:
grant update on admin.table1 to user1;
- Click Run All (
). - Repeat Step 1 through Step 3 to grant rights to any additional integration tables.