MCPcopy
hub / github.com/cloudfoundry/cli / displayRoleGroup

Method displayRoleGroup

command/v7/org_users_command.go:63–81  ·  view source on GitHub ↗
(usersWithRole []resources.User, roleLabel string)

Source from the content-addressed store, hash-verified

61}
62
63func (cmd OrgUsersCommand) displayRoleGroup(usersWithRole []resources.User, roleLabel string) {
64 v7action.SortUsers(usersWithRole)
65
66 cmd.UI.DisplayHeader(roleLabel)
67 if len(usersWithRole) > 0 {
68 for _, userWithRole := range usersWithRole {
69 cmd.UI.DisplayText(" {{.PresentationName}} ({{.Origin}})", map[string]interface{}{
70 "PresentationName": userWithRole.PresentationName,
71 "Origin": v7action.GetHumanReadableOrigin(userWithRole),
72 })
73 }
74 } else {
75 cmd.UI.DisplayText(" No {{.RoleLabel}} found", map[string]interface{}{
76 "RoleLabel": roleLabel,
77 })
78 }
79
80 cmd.UI.DisplayNewline()
81}
82
83func getUniqueUsers(orgUsersByRoleType map[constant.RoleType][]resources.User) []resources.User {
84 var allUsers []resources.User

Callers 1

displayOrgUsersMethod · 0.95

Calls 5

SortUsersFunction · 0.92
GetHumanReadableOriginFunction · 0.92
DisplayHeaderMethod · 0.65
DisplayTextMethod · 0.65
DisplayNewlineMethod · 0.65

Tested by

no test coverage detected