简体   繁体   English

将Orion实体分配给用户

[英]Assign Orion entities to users

I have switched our wirecloud instance login to Fiware IdM. 我已将wirecloud实例登录名切换为Fiware IdM。 I have there widget connected to Orion using NGSI source operator. 我有使用NGSI源操作器连接到Orion的小部件。 My question is how to assign entities in context broker to user - to different users see different entities. 我的问题是如何将上下文代理中的实体分配给用户-不同的用户看到不同的实体。

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. 应用此解决方案的主要问题是,当前版本的Orion(0.23)不支持使用过滤器搜索实体。 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. Orion的下一版本将提供该功能(请参阅@fganlan对此问题的回答 ),因此您必须等待该功能准备就绪。

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. 如果您现在需要此功能,那么我看到的唯一可行的解​​决方案是为每个有权访问该实体的用户添加一个属性(与此属性关联的值无关紧要),因为Orion允许使用属性列表来过滤实体,因此您可以查询Orion上下文代理查询包含与用户关联的属性的实体,如果该实体不包含该属性,则该用户无法访问该实体并进行过滤。

See this question about how to obtain logged user info from widgets. 请参阅有关如何从窗口小部件获取记录的用户信息的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM