Skip to main content
1-Visitor
February 27, 2019
Solved

Organization Creation With the Users through Scripting

  • February 27, 2019
  • 1 reply
  • 2056 views

Please give me the information about How to Create Organization through Scripting with the Different Users and password .

I Created one table with user name and password in Database, I want to run the script so that it create the organization with users and with the different accessibility.

Best answer by rosharma

@ShanuGarg : Under services - select Entities tab- from there select that entity on which you need to add permissions.

here we have snippets to provide all permissions (Visibility, Runtime & DesignTime)- for ex in below snippet i am assigning design time permissions to my testmashup

////////////////////

var params = {
principal: "userA" /* STRING */,
allow: true /* BOOLEAN */,
type: "Update" /* STRING */,
principalType: "User" /* STRING */
};

// no return
Mashups["testmashup"].AddDesignTimePermission(params);

1 reply

20-Turquoise
February 27, 2019

You can use EntityServices resource (snippet "CreateUser"), 


var params = {
password: undefined /* STRING */,
name: undefined /* STRING */,
description: undefined /* STRING */,
tags: undefined /* TAGS */
};

// no return
Resources["EntityServices"].CreateUser(params);

 

 

Similarly, with organization, CreateOrganization


var params = {
topOUName: undefined /* STRING */,
name: undefined /* STRING */,
description: undefined /* STRING */,
topOUDescription: undefined /* STRING */,
tags: undefined /* TAGS */
};

// no return
Resources["EntityServices"].CreateOrganization(params);

 

And look into setting permissions.

ShanuGarg1-VisitorAuthor
1-Visitor
February 28, 2019

That's fine,

but I also want to assign the permissions through Scripting

20-Turquoise
February 28, 2019
You can do that with the snippets as well.