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

Method DeletePermissionsForUserCtx

rbac_api_context.go:125–131  ·  view source on GitHub ↗

DeletePermissionsForUserCtx deletes permissions for a user or role with context support. Returns false if the user or role does not have any permissions (aka not affected).

(ctx context.Context, user string)

Source from the content-addressed store, hash-verified

123// DeletePermissionsForUserCtx deletes permissions for a user or role with context support.
124// Returns false if the user or role does not have any permissions (aka not affected).
125func (e *ContextEnforcer) DeletePermissionsForUserCtx(ctx context.Context, user string) (bool, error) {
126 subIndex, err := e.GetFieldIndex("p", constant.SubjectIndex)
127 if err != nil {
128 return false, err
129 }
130 return e.RemoveFilteredPolicyCtx(ctx, subIndex, user)
131}

Callers

nothing calls this directly

Calls 2

GetFieldIndexMethod · 0.45

Tested by

no test coverage detected