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

Method AddLink

rbac/role_manager.go:27–27  ·  view source on GitHub ↗

AddLink adds the inheritance link between two roles. role: name1 and role: name2. domain is a prefix to the roles (can be used for other purposes).

(name1 string, name2 string, domain ...string)

Source from the content-addressed store, hash-verified

25 // AddLink adds the inheritance link between two roles. role: name1 and role: name2.
26 // domain is a prefix to the roles (can be used for other purposes).
27 AddLink(name1 string, name2 string, domain ...string) error
28 // Deprecated: BuildRelationship is no longer required
29 BuildRelationship(name1 string, name2 string, domain ...string) error
30 // DeleteLink deletes the inheritance link between two roles. role: name1 and role: name2.

Callers 15

TestRoleFunction · 0.95
TestDomainRoleFunction · 0.95
TestClearFunction · 0.95
TestDomainPatternRoleFunction · 0.95
TestAllMatchingFuncFunction · 0.95
TestMatchingFuncOrderFunction · 0.95
TestTemporaryRolesFunction · 0.95
TestMaxHierarchyLevelFunction · 0.95
TestConcurrentHasLinkFunction · 0.95
AddLinkMethod · 0.65
copyFromMethod · 0.65

Implementers 3

RoleManagerImplrbac/default-role-manager/role_manager
DomainManagerrbac/default-role-manager/role_manager

Calls

no outgoing calls

Tested by 10

TestRoleFunction · 0.76
TestDomainRoleFunction · 0.76
TestClearFunction · 0.76
TestDomainPatternRoleFunction · 0.76
TestAllMatchingFuncFunction · 0.76
TestMatchingFuncOrderFunction · 0.76
TestTemporaryRolesFunction · 0.76
TestMaxHierarchyLevelFunction · 0.76
TestConcurrentHasLinkFunction · 0.76