如何访问cloudkit中的安全角色 [英] How do I access security role in cloudkit

查看:187
本文介绍了如何访问cloudkit中的安全角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用基于角色的安全性构建应用程序。我在Cloudkit Dashboard中构建了我的记录类型(项目,帐户,历史记录日志,财务,客户等),我也创建了安全角色。我的角色名为:Executive和DeptManager。我已经为记录类型分配了角色的适当访问权限。我还在特殊记录类型用户中为用户分配了Executive或DeptManager的角色。

I am building an app with Role based Security. I have built my Record Types (Projects, Accounts, HistoryLog, Financial, Customer, etc) in Cloudkit Dashboard, and I have created Security Roles as well. I have roles named: Executive and DeptManager. I have assigned to the Record Types the appropriate access by Role. I have also assigned to the user in the special Record Type "Users" the role of either Executive or DeptManager.

我已成功访问和操作记录类型中的数据。现在我在App中实现基于角色的查看。所以在第一个视图中有一个登录喜欢的功能,所以在我发现用户之后,我想在PickerView中显示该用户的角色供他们选择。一旦他们选择了一个角色,我就会将他们带到适当的视角。例如,我可能同时拥有DeptManager和Executive的角色。如果今天我选择了DeptManager,我将进入一个允许我输入生产指标的视图。如果有一天我选择Executive,我会看到报告给我的所有部门的绩效指标。

I have successfully accessed and manipulated data in the Record Types. Now I am implementing Role based viewing in the App. So on the first view there is a log in "like" feature, so after i discover the user, I want to display the Roles of that user in a PickerView for them to select. Once they select a role I will them take them to the appropriate view. For example I may have the role of both DeptManager and Executive. If today I select DeptManager, I will be taken to a view that allows me to enters Production Metrics. If another day I select Executive, I will see performance metrics for all the departments that report to me.

这是来自CloudKit Dashboard的图片,显示我正在尝试的信息检索。提前感谢您的任何建议。

Here is an image from CloudKit Dashboard showing the info I'm trying to retrieve. Thanks in advance for any advice.

推荐答案

目前无法获取用户所在的角色。目前返回的信息是discoverUserInfoWithUserRecordID非常有限。我也希望它能尽快延长。目前,您只获得userRecordID,名字和姓氏。如果您确实需要这样的功能,那么唯一的解决方案是创建一个可以查询的影子注册。然后,您将面临一个挑战,即保持这两个同步。这必须手动完成。

Currently it is not possible to get the roles a user is in. At the moment the information that is returned from the discoverUserInfoWithUserRecordID is very limited. I also hope it will be extended soon. Currently you only get a userRecordID, first name and last name. If you do want such functionality, then the only solution is creating a shadow registration which you could query. You then would have a challenge keeping these 2 in sync. That has to be done manually.

这篇关于如何访问cloudkit中的安全角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆