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

Function Role

coderd/database/db2sdk/db2sdk.go:865–879  ·  view source on GitHub ↗
(role database.CustomRole)

Source from the content-addressed store, hash-verified

863}
864
865func Role(role database.CustomRole) codersdk.Role {
866 orgID := ""
867 if role.OrganizationID.UUID != uuid.Nil {
868 orgID = role.OrganizationID.UUID.String()
869 }
870
871 return codersdk.Role{
872 Name: role.Name,
873 OrganizationID: orgID,
874 DisplayName: role.DisplayName,
875 SitePermissions: slice.List(role.SitePermissions, Permission),
876 UserPermissions: slice.List(role.UserPermissions, Permission),
877 OrganizationPermissions: slice.List(role.OrgPermissions, Permission),
878 }
879}
880
881func Permission(permission database.CustomRolePermission) codersdk.Permission {
882 return codersdk.Permission{

Callers 3

assignableRolesFunction · 0.92
postOrgRolesMethod · 0.92
putOrgRolesMethod · 0.92

Calls 2

ListFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected