Skip to main content
1-Visitor
July 14, 2017
Solved

Setting visibility of individual entities programmatically

  • July 14, 2017
  • 2 replies
  • 2230 views

Hi,

does would anyone know which service to use to set the visibility on an individual entity. If you could provide an example that would be great.

Currently I create networks, things and organisations and organisational units programmatically using data from a mashup. I would also like to be able to set the visibility of the things & networks at the same time, but can't seem to find a suitable service. I have seen discussions concerning 'collections' but I want to set it on an individual basis.

Thanks,

Kieron

Best answer by CarlesColl

Hi Kieron,

To set visibility of one Organizational Unit at Thing's level:

thing.AddVisibilityPermission({

     name: "principalName", // -- like: "OrganizationName:OrganizationUnitName"

    type: "OrganizationalUnit"

});

If you want to set it for Organization at Thing's level:

thing.AddVisibilityPermission({

     name: "principalName", // -- like: "Organization"

    type: "Organization"

});

2 replies

1-Visitor
July 14, 2017

Hi Kieron,

To set visibility of one Organizational Unit at Thing's level:

thing.AddVisibilityPermission({

     name: "principalName", // -- like: "OrganizationName:OrganizationUnitName"

    type: "OrganizationalUnit"

});

If you want to set it for Organization at Thing's level:

thing.AddVisibilityPermission({

     name: "principalName", // -- like: "Organization"

    type: "Organization"

});

khayes11-VisitorAuthor
1-Visitor
July 14, 2017

Hi Carles,

that's the one, thank you for the quick response, you're a star.

Kieron