MCPcopy Index your code
hub / github.com/apache/casbin / GetImplicitUsersForResource

Method GetImplicitUsersForResource

rbac_api.go:535–537  ·  view source on GitHub ↗

GetImplicitUsersForResource return implicit user based on resource. for example: p, alice, data1, read p, bob, data2, write p, data2_admin, data2, read p, data2_admin, data2, write g, alice, data2_admin GetImplicitUsersForResource("data2") will return [[bob data2 write] [alice data2 read] [alice dat

(resource string)

Source from the content-addressed store, hash-verified

533// GetImplicitUsersForResource("data1") will return [[alice data1 read]]
534// Note: only users will be returned, roles (2nd arg in "g") will be excluded.
535func (e *Enforcer) GetImplicitUsersForResource(resource string) ([][]string, error) {
536 return e.GetNamedImplicitUsersForResource("g", resource)
537}
538
539// GetNamedImplicitUsersForResource return implicit user based on resource with named policy support.
540// This function handles resource role relationships through named policies (e.g., g2, g3, etc.).

Callers 1

Tested by 1