Skip to main content
1-Visitor
March 5, 2020
Solved

Create and Delete Thing Permission Issue

  • March 5, 2020
  • 1 reply
  • 3900 views

Hello Everyone,

I have a service, that uses the createThing and deleteThing Services.
I gave a freshly created user the rights to execute the service and also the createThing and deleteThing services. But I still get the error
"...Not authorized for Delete - See Script Error Log for more details."

I only found some very old posts regarding this issue, which didn't solve it for me. 

Any ideas what to do here?

 

Thank you very much in advance!

 

Best Regards,

Dominik

Best answer by Constantine

Please try to add a design-time permission to create things to System user on the Things collection level.

 

/ Constantine

1 reply

18-Opal
March 5, 2020

Hello Dominik,

 

So what does ScriptLog and ApplicationLog say?

 

You also need to set design-time permissions on those things that you are deleting, not just runtime. You can do it either on the thing template level, or on a whole Things collection.

 

Regards,
Constantine

dr11-VisitorAuthor
1-Visitor
March 6, 2020

Hello Constantine, 

thank you for your reply!

Unfortunately the Logs don't give usefull hints

Application Log:
Execution error in service script [createNodeInFolder] :: Not authorized for Create

Script Log:

Error in: projectOverviewRepo.createNodeInFolder javascript service

 

Here is a snipped from the code of the service:

var params = {
name: name /* STRING */,
description: undefined /* STRING */,
thingTemplateName: "projectRepositoryTemplate" /* THINGTEMPLATENAME */,
tags: undefined /* TAGS */
};

// no return
Resources["EntityServices"].CreateThing(params);
Things[name].EnableThing();
Things[name].RestartThing();

 

 

These are the permission configurations for "EntityServices" (Resrouces)

 

 

These are the permissions from the ThingTemplate that I want to create a Thing from

Run Time (same config for Run Time and Run Time Instance)

image.png

Design Time (same for Run Time and Run Time Instance)

 
dr11-VisitorAuthor
1-Visitor
March 6, 2020

Design Time (Same for Run Time and Run Time instance)

image.png

and Visibility for the organization that contains my user

 

Best Regards,

Dominik