如何在一次调用中从 AzMan 获取所有配置的操作?
我在 .net C# 应用程序中使用授权管理器。在应用程序启动期间,我缓存用户有权访问的所有操作,然后使用此缓存的数据进行进一步处理。问题是 - 我一次只能检查一项操作的访问权限,因此如果我在 azman 中有 100 次操作,并且用户仅配置了 5 条规则,我仍然需要对 AzMan 进行 100 次调用才能获取所有配置的规则。有什么方法可以仅在一次调用中获取用户的所有配置规则吗?
I'm using Authorization Manager in my .net C# application. During application startup, I cache all the operations for which the user has access then use this cached data for further processing. The issue is - I can check access only for one operation at a time so if I have 100s operations in azman and user is provisined only for 5 rules, still I need to make 100 calls to AzMan to get all the provisioned rules. Is there any way I can get all the provisioned rule for a user in one call only?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IAzClientContext.AccessCheck
允许您传入操作 ID 数组。我做了这样的事情:
我还没有测试过它能处理多少个,而且我通常一次只做一个。但理论上它会起作用。
我也没有尝试在多个范围内执行此操作(我必须使用较旧的 AzMan 1.0 架构,它不支持 AccessCheck 中的多个范围)。
IAzClientContext.AccessCheck
allows you to pass in an array of operation IDs.I do something like this:
I haven't tested to see how many it will handle, and I usually do just one at a time. But in theory it would work.
I also have not tried to do this with multiple scopes (I have to use the older AzMan 1.0 schema which did not support multiple scopes in the AccessCheck).