知识卡片

普通读书笔记卡 · 273.a.1.c.1

授权要支持可见资源查询

理解等级:高级

授权不仅要判断“此用户能否对此资源做此动作”,还要回答“此用户能看见哪些资源并做什么”。后者决定列表和界面是否先展示再拒绝,直接影响体验。手写每处if判断容易使两种查询失步;选授权模型时应验证资源筛选能力,而不只测单次允许或拒绝。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 宏观架构中的安全 · 查看原书依据

      Authorization logic needs to support two kinds of queries. The first query is given a user, a resource, an action, and whether the user can perform an action on the resource. The second query is given a user, all the resources they can use, and the actions they can carry out. The latter query is required for building reasonable user experiences because showing a user some resources and then denying access to the same resource leads to unpleasant user experiences.

    参考来源

    - 位置:《Software Architecture and Decision-Making》第08章《宏观架构中的安全》(来源项目:book-sources;源文件:extracted/Software Architecture and Decision-Making Leveraging Leadership, Technology, and Product Management to Build Great Products… (Srinath Perera)/_epub-src/ch08.xhtml) - 结论依据:所引连续原文给出本卡机制或取舍;条件与示例结合本节已读上下文解释。 - 原始内容:Authorization logic needs to support two kinds of queries. The first query is given a user, a resource, an action, and whether the user can perform an action on the resource. The second query is given a user, all the resources they can use, and the actions they can carry out. The latter query is required for building reasonable user experiences because showing a user some resources and then denying access to the same resource leads to unpleasant user experiences.