[英]Role-based access control with Pyramid
Well Pyramid implements an ACL authorization policy which maps principals to permissions. Well Pyramid实现了ACL授权策略,该策略将主体映射到权限。
Maybe I'm wrong, but RBAC seems to fit pretty naturally into this idea. 也许我错了,但RBAC似乎非常适合这个想法。 I understand that RBAC tends to be more of a global policy whereas ACLs are generally contextual and thus attached to the data. 我知道RBAC往往更像是一个全局策略,而ACL通常是上下文的,因此附加到数据上。 This isn't really a problem though and depends on how you plan to structure the rest of your application. 这不是一个真正的问题,取决于您计划如何构建应用程序的其余部分。
You could also fairly simply implement your own RBACAuthorizationPolicy
. 您也可以相当简单地实现自己的RBACAuthorizationPolicy
。 In Pyramid it will be passed the principals and the permission and from there you could query your access mappings to determine whether to return an Allowed
or Denied
value for that user. 在Pyramid中,它将传递主体和权限,然后您可以查询访问映射以确定是否为该用户返回“ Allowed
或“ Denied
值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.