4 Replies Latest reply on Apr 5, 2016 7:19 AM by jdaniel RSS
    jdaniel Newbie

    How to programmatically add visibility permissions?

    How do you programmatically refer to a sub-organization in the following example?  I want to add a sub-organization to the visibility permissions of an existing Thing.  The service snippet looks like the following but there's no information on the requirements or formatting of the "principal" and "principalType" strings.

     

    var params = {

      principal: mySubOrganization,

      principalType: "Organization"

    };

    Things["myThing"].AddVisibilityPermission(params);

     

    If I have an organization named “Org” and that organization contains a sub-organization called “Sub”, what should I enter for the "principal" string?  Is this the proper form of the property?

    mySubOrganizaiton = "Org:Sub";


    Next, what is the correct string to use for the "principalType"?  I've tried "Organization", "OrganizationUnit", and "Organization Unit" without success.


    Lastly, where is this information documented?


    Thanks -