MCPcopy
hub / github.com/apache/casbin / GetRolesForUser

Method GetRolesForUser

rbac_api_synced.go:18–22  ·  view source on GitHub ↗

GetRolesForUser gets the roles that a user has.

(name string, domain ...string)

Source from the content-addressed store, hash-verified

16
17// GetRolesForUser gets the roles that a user has.
18func (e *SyncedEnforcer) GetRolesForUser(name string, domain ...string) ([]string, error) {
19 e.m.RLock()
20 defer e.m.RUnlock()
21 return e.Enforcer.GetRolesForUser(name, domain...)
22}
23
24// GetUsersForRole gets the users that has a role.
25func (e *SyncedEnforcer) GetUsersForRole(name string, domain ...string) ([]string, error) {

Callers

nothing calls this directly

Calls 1

GetRolesForUserMethod · 0.65

Tested by

no test coverage detected