VMware Cloud Community
iancollins
Contributor
Contributor

share vCD catalog with all users of an Org

Hi All,

I am trying to find a way to share a catalog using vRO.  We have an org that holds the catalogs and i want to automate giving a new Org read only access to one of the shared catalogs.  I have looked thru the built-in workflows and actions and cant find one that allows all users of a Org to be given read only access, as you can in the UI.

Does anyone have an example of how to do that?

I a using vCD 8.20 and vRO 7.21.

Thanks

Ian...

0 Kudos
1 Reply
iancollins
Contributor
Contributor

Hi Again,

Having spent the morning googling and "playing" i have managed to get ti to work, its not pretty and not knowing how to manipulate XML in JavaScript, i have resorted to treating the XML as a big string.

Using getCatalogControlAccessByReferenceOrg

then:-

var accessSettings = actionResult.toXml();

var newSection = '<ns6:AccessSetting>      <ns6:Subject href="'+org.href+'" name="'+org.name+'" type="application/vnd.vmware.admin.organization+xml"/>    <ns6:AccessLevel>ReadOnly</ns6:AccessLevel>    </ns6:AccessSetting>';

var accessSettingsEnd = accessSettings.indexOf("</ns6:AccessSettings>");

var accessSettingsStart = accessSettings.substring(0,accessSettingsEnd);

var accessSettingsFinish = accessSettings.substring(accessSettingsEnd,accessSettings.length);

accessSettingsStart += newSection;

accessSettingsStart += accessSettingsFinish;

var newAccessSettings = new VclControlAccessParams();

newAccessSettings.loadFromXml(accessSettingsStart);

and then updateCatalogControlAccessByReferenceOrg

i can share a catalog to an org.

I home that is helpful to someone else, and if anyone knows how to insert the newSection XML into the XML document using "proper" XML tools in javaScript, I would be very interested to lean how.

Regards,

Ian...

0 Kudos