cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Organization Creation With the Users through Scripting

ShanuGarg
8-Gravel

Organization Creation With the Users through Scripting

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.

1 ACCEPTED SOLUTION

Accepted Solutions

@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);

View solution in original post

6 REPLIES 6
posipova
20-Turquoise
(To:ShanuGarg)

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.

That's fine,

but I also want to assign the permissions through Scripting

posipova
20-Turquoise
(To:ShanuGarg)

You can do that with the snippets as well.

How?

@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);

slangley
23-Emerald II
(To:rosharma)

Hi @ShanuGarg.

 

If one of the previous responses answered your question, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Top Tags