2
votes

I have switched our wirecloud instance login to Fiware IdM. I have there widget connected to Orion using NGSI source operator. My question is how to assign entities in context broker to user - to different users see different entities.

1
do you require to have an authorisation mechanism (e.g. user permissions over entities)? can you provide us what are you trying to use as criteria for selecting what entities are going to be displayed to the different users? E.g. is your idea to provide a user whitelist on each entity or something similar?Álvaro Arranz
Yes, i was thinking about some whitelist.Marek

1 Answers

0
votes

Probably the best way to implement this is by adding a "users" attribute to the entities. This "users" attribute would contain the white list of users with access to that entity.

The main problem for applying this solutions is that the current version of Orion (0.23) doesn't support searching entities using filters. Next versions of Orion are going to provide that functionality (see @fganlan answer to this question) so you have to wait until this functionality is ready.

If you need this feature now, the only viable solution that I see is to add an attribute per user with access to the entity (the value associated with this attribute is irrelevant) as orion allows filtering entities using a list of attributes, so you can query orion context broker asking for entities containing the attribute associated to the user, if the entity doesn't contain that attribute is not accesible to that user and filtered.

See this question about how to obtain logged user info from widgets.