Skip to content

使用add_grouping_policy添加子角色继承, 但是require在判定角色时不能识别继承的子角色 #42

@one-pyy

Description

@one-pyy
await auth.create_role_user("admin")
await auth.create_role_user("root")
await auth.enforcer.add_grouping_policy("r:root", "r:admin")
# 在dependencies中使用root验证auth.requires("admin")失败

在auth.has_role_for_user函数中, 能否使用self.enforcer.get_implicit_roles_for_user再自己判定呢?

(也看到casbin没有提供has_implicit_roles_for_user了, 可能这其中有效率之类的考虑。如果是我的使用方式有问题, 请告诉我, 非常感谢!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions