Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commands: show globabl permissions when getting users #230

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading