casbin / Casbin.NET

An authorization library that supports access control models like ACL, RBAC, ABAC in .NET (C#)

Home Page:https://casbin.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check collection in ABAC with policy

resah opened this issue · comments

commented

Hi, I am using ABAC with policy and wanted to check, if the user has a necessary claim for a resource property. Something like

p, r.obj.Group in r.sub.Claims, create
p, r.obj.Group in r.sub.Claims && r.sub.Name == r.obj.CreatedBy, delete

Is this possible? Should r.sub.Claims then be an array, enumerable, list, ...?

@resah It will work, and the r.sub.Claims should be an IEnumerable at least.