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

Method AddRoleForUserInDomain

rbac_api_with_domains.go:49–51  ·  view source on GitHub ↗

AddRoleForUserInDomain adds a role for a user inside a domain. Returns false if the user already has the role (aka not affected).

(user string, role string, domain string)

Source from the content-addressed store, hash-verified

47// AddRoleForUserInDomain adds a role for a user inside a domain.
48// Returns false if the user already has the role (aka not affected).
49func (e *Enforcer) AddRoleForUserInDomain(user string, role string, domain string) (bool, error) {
50 return e.AddGroupingPolicy(user, role, domain)
51}
52
53// DeleteRoleForUserInDomain deletes a role for a user inside a domain.
54// Returns false if the user does not have the role (aka not affected).

Callers 2

TestUserAPIWithDomainsFunction · 0.95
TestRoleAPIWithDomainsFunction · 0.95

Calls 1

AddGroupingPolicyMethod · 0.95

Tested by 2

TestUserAPIWithDomainsFunction · 0.76
TestRoleAPIWithDomainsFunction · 0.76