简体   繁体   English

为HomeKit中的附件设置来宾用户的自定义权限

[英]Set custom permission to guest user for accessory in HomeKit

I have created the guest user for a home using Apple's HomeKit framework. 我已经使用Apple的HomeKit框架为家庭创建了来宾用户。 Guest user is now can read and write characteristics of appliance. 来宾用户现在可以读写设备的特征。
My question is how to set custom permission for the guest user. 我的问题是如何为访客用户设置自定义权限。 ie I don't want guest user to be change the characteristics value for particular appliance. 即我不希望来宾用户更改特定设备的特征值。
Also is their any Apple documentation explaining the permission. 也是他们的任何Apple文档都说明了许可。
I have gone through link : https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/HomeKitDeveloperGuide/ManagingUsers/ManagingUsers.html 我已经通过链接: https : //developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/HomeKitDeveloperGuide/ManagingUsers/ManagingUsers.html

There is very limited user access control for accessories. 附件的用户访问控制非常有限。 Apple has defined a standard characteristic type, Admin only access, that you can set to prohibit any users who are not the admin from interacting with the accessory, but that's an accessory level limitation (rather than being enforced in the homekit API). Apple定义了一个标准的特征类型,即“仅管理员”访问权限,您可以将其设置为禁止任何非管理员用户与附件交互,但这是附件级别的限制(而不是在homekit API中强制执行)。 As such, it requires the accessory implement support for that characteristic. 因此,它需要附件支持该特性。

Other more complex schemes are possible, but require specific accessory support, ie the accessory maker would need to create some sort of API to manage user access. 其他更复杂的方案也是可能的,但是需要特定的附件支持,即附件制造商将需要创建某种API来管理用户访问。 To my knowledge, no accessories currently support this, and there isn't anything standard from apple (yet). 据我所知,目前尚无配件支持此功能,而且苹果还没有任何标准配件。

In the HomeKit Accessory simulator you can simulate a device that has this by adding a characteristic to your device that has the type HMCharacteristicTypeAdminOnlyAccess and set the value to true. 在HomeKit配件模拟器中,您可以通过向设备添加类型为HMCharacteristicTypeAdminOnlyAccess的特征并将其设置为true来模拟具有此功能的设备。 Otherwise the device manufacturer needs to add this characteristic in their service. 否则,设备制造商需要在其服务中添加此特性。

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

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