Skip to content

Commit

Permalink
commands: show globabl permissions when getting users (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-prosser authored Oct 2, 2023
1 parent 2698716 commit a69fc08
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Unreleased

- Show Global Permissions in `get users`
- Upgrade `ordered-float` version, which is exposed in the public crate api.

## v0.19.0
Expand Down
1 change: 1 addition & 0 deletions api/src/resources/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ pub struct User {
pub global_permissions: HashSet<GlobalPermission>,
#[serde(rename = "organisation_permissions")]
pub project_permissions: HashMap<ProjectName, HashSet<ProjectPermission>>,
pub sso_global_permissions: HashSet<GlobalPermission>,
pub verified: bool,
}

Expand Down
8 changes: 7 additions & 1 deletion cli/src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl DisplayTable for Stream {

impl DisplayTable for User {
fn to_table_headers() -> Row {
row![bFg => "Name", "Email", "ID", "Created (UTC)"]
row![bFg => "Name", "Email", "ID", "Created (UTC)", "Global Permissions"]
}

fn to_table_row(&self) -> Row {
Expand All @@ -221,6 +221,12 @@ impl DisplayTable for User {
self.email.0,
self.id.0,
self.created_at.format("%Y-%m-%d %H:%M:%S"),
self.global_permissions
.iter()
.chain(self.sso_global_permissions.iter())
.map(|permission| permission.to_string())
.collect::<Vec<String>>()
.join(", ")
]
}
}
Expand Down

0 comments on commit a69fc08

Please sign in to comment.