Skip to content

Commit

Permalink
cli: authn show role + user verbose fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Koo <[email protected]>
  • Loading branch information
rkoo19 committed Nov 11, 2024
1 parent 16d01e7 commit 95a05e0
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions cmd/cli/teb/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,33 +280,32 @@ See '--help' and docs/cli for details.`
"{{end}}\n" +
"{{end}}"

AuthNUserVerboseTmpl = "Name\t{{ .Name }}\n" +
"Roles\t{{ JoinList .Roles }}\n" +
"{{ if ne (len .ClusterACLs) 0 }}" +
AuthNUserVerboseTmpl = "Name\t{{ .ID }}\n" +
"Roles\t{{ range $i, $role := .Roles }}{{ if $i }}, {{ end }}{{ $role.Name }}{{ end }}\n" +
"{{ range $role := .Roles }}" +
"{{ if ne (len $role.ClusterACLs) 0 }}" +
"CLUSTER ID\tALIAS\tPERMISSIONS\n" +
"{{ range $clu := .ClusterACLs}}" +
"{{ $clu.ID}}\t{{ $clu.Alias }}\t{{ FormatACL $clu.Access }}\n" +
"{{ range $clu := $role.ClusterACLs }}" +
"{{ $clu.ID }}\t{{ $clu.Alias }}\t{{ FormatACL $clu.Access }}\n" +
"{{end}}{{end}}" +
"{{ if ne (len .BucketACLs) 0 }}" +
"{{ if ne (len $role.BucketACLs) 0 }}" +
"BUCKET\tPERMISSIONS\n" +
"{{ range $bck := .BucketACLs}}" +
"{{ $bck }}\t{{ FormatACL $bck.Access }}\n" +
"{{end}}{{end}}"
"{{ range $bck := $role.BucketACLs }}" +
"{{ FormatBckName $bck.Bck }}\t{{ FormatACL $bck.Access }}\n" +
"{{end}}{{end}}" +
"{{ end }}"

AuthNRoleVerboseTmpl = "Role\t{{ .Name }}\n" +
"Description\t{{ .Description }}\n" +
"{{ if ne (len .Roles) 0 }}" +
"Roles\t{{ JoinList .Roles }}\n" +
"{{ end }}" +
"{{ if ne (len .ClusterACLs) 0 }}" +
"CLUSTER ID\tALIAS\tPERMISSIONS\n" +
"{{ range $clu := .ClusterACLs}}" +
"{{ $clu.ID}}\t{{ $clu.Alias }}\t{{ FormatACL $clu.Access }}\n" +
"{{ range $clu := .ClusterACLs }}" +
"{{ $clu.ID }}\t{{ $clu.Alias }}\t{{ FormatACL $clu.Access }}\n" +
"{{end}}{{end}}" +
"{{ if ne (len .BucketACLs) 0 }}" +
"BUCKET\tPERMISSIONS\n" +
"{{ range $bck := .BucketACLs}}" +
"{{ $bck }}\t{{ FormatACL $bck.Access }}\n" +
"{{ range $bck := .BucketACLs }}" +
"{{ FormatBckName $bck.Bck }}\t{{ FormatACL $bck.Access }}\n" +
"{{end}}{{end}}"

// `search`
Expand Down

0 comments on commit 95a05e0

Please sign in to comment.