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

Method HasRoleForUser

rbac_api_synced.go:32–36  ·  view source on GitHub ↗

HasRoleForUser determines whether a user has a role.

(name string, role string, domain ...string)

Source from the content-addressed store, hash-verified

30
31// HasRoleForUser determines whether a user has a role.
32func (e *SyncedEnforcer) HasRoleForUser(name string, role string, domain ...string) (bool, error) {
33 e.m.RLock()
34 defer e.m.RUnlock()
35 return e.Enforcer.HasRoleForUser(name, role, domain...)
36}
37
38// AddRoleForUser adds a role for a user.
39// Returns false if the user already has the role (aka not affected).

Callers

nothing calls this directly

Calls 1

HasRoleForUserMethod · 0.65

Tested by

no test coverage detected