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

Method DeletePermissionForUser

rbac_api.go:170–172  ·  view source on GitHub ↗

DeletePermissionForUser deletes a permission for a user or role. Returns false if the user or role does not have the permission (aka not affected).

(user string, permission ...string)

Source from the content-addressed store, hash-verified

168// DeletePermissionForUser deletes a permission for a user or role.
169// Returns false if the user or role does not have the permission (aka not affected).
170func (e *Enforcer) DeletePermissionForUser(user string, permission ...string) (bool, error) {
171 return e.RemovePolicy(util.JoinSlice(user, permission...))
172}
173
174// DeletePermissionsForUser deletes permissions for a user or role.
175// Returns false if the user or role does not have any permissions (aka not affected).

Callers 1

TestPermissionAPIFunction · 0.95

Calls 2

RemovePolicyMethod · 0.95
JoinSliceFunction · 0.92

Tested by 1

TestPermissionAPIFunction · 0.76