Add authorized actions output on resources (#870)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2021-01-20 10:53:01 -05:00
1 parent ec6151d174
commit dcb15cffbd
93 files changed
+2475 -1038

No files matched your search

+8
View File
@@ -110,6 +110,14 @@ func generateUserTableOutput(in *users.User) string {
base.ScopeInfoForOutput(in.Scope, maxLength),
}
if len(in.AuthorizedActions) > 0 {
ret = append(ret,
"",
" Authorized Actions:",
base.WrapSlice(4, in.AuthorizedActions),
)
}
if len(in.Accounts) > 0 {
ret = append(ret,
"",
+10 -4
View File
@@ -247,18 +247,24 @@ func (c *Command) Run(args []string) int {
}
if true {
output = append(output,
fmt.Sprintf(" ID: %s", u.Id),
fmt.Sprintf(" Version: %d", u.Version),
fmt.Sprintf(" ID: %s", u.Id),
fmt.Sprintf(" Version: %d", u.Version),
)
}
if u.Name != "" {
output = append(output,
fmt.Sprintf(" Name: %s", u.Name),
fmt.Sprintf(" Name: %s", u.Name),
)
}
if u.Description != "" {
output = append(output,
fmt.Sprintf(" Description: %s", u.Description),
fmt.Sprintf(" Description: %s", u.Description),
)
}
if len(u.AuthorizedActions) > 0 {
output = append(output,
" Authorized Actions:",
base.WrapSlice(6, u.AuthorizedActions),
)
}
}