Create a Container with Default Module via JavaScript

LabKey Support Forum (Inactive)
Create a Container with Default Module via JavaScript bront  2015-04-06 15:03
Status: Closed
 
I see where I can create a new container via JavaScript:

LABKEY.Security.createContainer({
name:'testLab'
})

Is it also possible with JavaScript, to add a module to this newly created container (and maybe assign permissions)?

Thanks,

bront
 
 
Jon (LabKey DevOps) responded:  2015-04-06 16:23
Hi Bront,

You can assign permissions via the LABKEY.Security.savePolicy (https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.Security.html#.savePolicy), but there is nothing within the JavaScript API to allow you to enable/disable modules. The only option when it comes to modules is to see what modules are installed and whether they're active & enabled for the specific container you're looking at via LABKEY.Security.getModules (https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.Security.html#.getModules)

Regards,

Jon
 
bront responded:  2015-04-07 10:10
Jon,

That works. Thanks for the info (and quick response).

cheers,

bront
 
kevink responded:  2015-04-07 10:47
Bront,

You can specify a folder type when creating the container. A custom folder type can specify which modules are enabled by default:

https://help.labkey.org/wiki/home/Documentation/page.view?name=customFolderTypes

Kevin