MCPcopy Index your code
hub / github.com/coder/coder / RBACRole

Function RBACRole

coderd/database/db2sdk/db2sdk.go:850–863  ·  view source on GitHub ↗
(role rbac.Role)

Source from the content-addressed store, hash-verified

848}
849
850func RBACRole(role rbac.Role) codersdk.Role {
851 slim := SlimRole(role)
852
853 orgPerms := role.ByOrgID[slim.OrganizationID]
854 return codersdk.Role{
855 Name: slim.Name,
856 OrganizationID: slim.OrganizationID,
857 DisplayName: slim.DisplayName,
858 SitePermissions: slice.List(role.Site, RBACPermission),
859 UserPermissions: slice.List(role.User, RBACPermission),
860 OrganizationPermissions: slice.List(orgPerms.Org, RBACPermission),
861 OrganizationMemberPermissions: slice.List(orgPerms.Member, RBACPermission),
862 }
863}
864
865func Role(role database.CustomRole) codersdk.Role {
866 orgID := ""

Callers 2

assignableRolesFunction · 0.92
convertRoleFunction · 0.92

Calls 2

ListFunction · 0.92
SlimRoleFunction · 0.70

Tested by 1

convertRoleFunction · 0.74