User has not permission to do something.
Hello,
I am new at thingworx, trying to setup some things in my test instance.
I am currently figuring out how I the users should be managed.
Small chronology:
- After setting up installation, I have an admin user.
- For this, I created a appkey.
- Using the appkey I was able to tell my sensor where to send the data to.
- Data is sent to a "InstallerThing" i created, that has a service to either create a new thing or update the values.
- Everything is working fine so far.
Code of InstallerThing:
var thingName = "test_" + hardware_serial ;
if(!Things[thingName])
{
Resources["EntityServices"].CreateThing({
name: thingName /* STRING */,
description: "new thing in room "+ dev_id /* STRING */,
tags: undefined /* TAGS */,
thingTemplateName: "MyRoomSensor" /* THINGTEMPLATENAME */
});
Things[thingName].EnableThing();
Things[thingName].RestartThing();
}
Things[thingName].humidity = payload_fields.humidity;
Things[thingName].temperature = payload_fields.temp;
Things[thingName].pressure = payload_fields.pressure;
Things[thingName].room = dev_id;
But is was/is the appkey for Administrator, which I would assume not to be ideal to "store" this in my device.
So I created a new user, "thingsUser" and a key for this one.
But I looks as if this user can not do any thing at all.
- So I added a new orginazation and added the user
- I added the organization to the "InstallerThing" permissions (Visibility Tab)
(Still not working)
- in permissions/Run Time and Design Time
(Then it appeared in the list and I could see content - When loggin in with this user)
Then I used this appKey for my device to post data to the "InstallerThing".
But there I am getting errors.
If the thing is new, I am getting this:
Entity [EntityServices] does not exist
If the thing already exists, I am getting this:
Entity [myExistingEntity] does not exist.
I guess I got something wrong concerning user management and/or organizations.
So the question is:
- Do I need an extra user for security reason at all?
- How can a user do anything, like creating new things? I should mention here, that the new user has all checkboxes checked in User Profile settings.
- or how can the code of a service can be executed in the context of another permission?

