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

Method DeleteRoleForUser

rbac_api.go:87–91  ·  view source on GitHub ↗

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

(user string, role string, domain ...string)

Source from the content-addressed store, hash-verified

85// DeleteRoleForUser deletes a role for a user.
86// Returns false if the user does not have the role (aka not affected).
87func (e *Enforcer) DeleteRoleForUser(user string, role string, domain ...string) (bool, error) {
88 args := []string{user, role}
89 args = append(args, domain...)
90 return e.RemoveGroupingPolicy(args)
91}
92
93// DeleteRolesForUser deletes all roles for a user.
94// Returns false if the user does not have any roles (aka not affected).

Callers 3

TestRoleAPIFunction · 0.95
TestRoleAPI_DomainsFunction · 0.95

Calls 1

RemoveGroupingPolicyMethod · 0.95

Tested by 3

TestRoleAPIFunction · 0.76
TestRoleAPI_DomainsFunction · 0.76