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

Method HasPermissionForUser

rbac_api_synced.go:141–145  ·  view source on GitHub ↗

HasPermissionForUser determines whether a user has a permission.

(user string, permission ...string)

Source from the content-addressed store, hash-verified

139
140// HasPermissionForUser determines whether a user has a permission.
141func (e *SyncedEnforcer) HasPermissionForUser(user string, permission ...string) (bool, error) {
142 e.m.RLock()
143 defer e.m.RUnlock()
144 return e.Enforcer.HasPermissionForUser(user, permission...)
145}
146
147// GetImplicitRolesForUser gets implicit roles that a user has.
148// Compared to GetRolesForUser(), this function retrieves indirect roles besides direct roles.

Callers

nothing calls this directly

Calls 1

HasPermissionForUserMethod · 0.65

Tested by

no test coverage detected