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

Method GetUsersForRole

rbac_api.go:39–46  ·  view source on GitHub ↗

GetUsersForRole gets the users that has a role.

(name string, domain ...string)

Source from the content-addressed store, hash-verified

37
38// GetUsersForRole gets the users that has a role.
39func (e *Enforcer) GetUsersForRole(name string, domain ...string) ([]string, error) {
40 rm := e.GetRoleManager()
41 if rm == nil {
42 return nil, fmt.Errorf("role manager is not initialized")
43 }
44 res, err := rm.GetUsers(name, domain...)
45 return res, err
46}
47
48// HasRoleForUser determines whether a user has a role.
49func (e *Enforcer) HasRoleForUser(name string, role string, domain ...string) (bool, error) {

Callers

nothing calls this directly

Calls 2

GetRoleManagerMethod · 0.95
GetUsersMethod · 0.65

Tested by

no test coverage detected