MCPcopy Create free account
hub / github.com/apache/casbin / GetImplicitUsersForPermission

Method GetImplicitUsersForPermission

rbac_api_synced.go:199–203  ·  view source on GitHub ↗

GetImplicitUsersForPermission gets implicit users for a permission. For example: p, admin, data1, read p, bob, data1, read g, alice, admin GetImplicitUsersForPermission("data1", "read") will get: ["alice", "bob"]. Note: only users will be returned, roles (2nd arg in "g") will be excluded.

(permission ...string)

Source from the content-addressed store, hash-verified

197// GetImplicitUsersForPermission("data1", "read") will get: ["alice", "bob"].
198// Note: only users will be returned, roles (2nd arg in "g") will be excluded.
199func (e *SyncedEnforcer) GetImplicitUsersForPermission(permission ...string) ([]string, error) {
200 e.m.RLock()
201 defer e.m.RUnlock()
202 return e.Enforcer.GetImplicitUsersForPermission(permission...)
203}
204
205// GetImplicitObjectPatternsForUser returns all object patterns (with wildcards) that a user has for a given domain and action.
206// For example:

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected