Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

list all content by a user #29

Merged

Conversation

kmasiello
Copy link
Collaborator

Addresses #11

Only did this for a single user. The issue stated "for a set of users / group" but:

a) groups do not own content
b) the recipe can be iterated by the end user to get content for multiple users.

If there's a strong desire to see this modified to list content by multiple users, LMK

@kmasiello kmasiello linked an issue Apr 16, 2024 that may be closed by this pull request
@kmasiello kmasiello self-assigned this Apr 16, 2024
Copy link
Collaborator

@tdstein tdstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python bits look good. Can't speak for the R content.

content/content-by-user/index.qmd Show resolved Hide resolved
Comment on lines 87 to 92
user_guid = client.users.find_one(prefix = username).guid
#TODO: update `prefix` per https://github.com/posit-dev/posit-sdk-py/issues/173

### Get list of content owned by specified user
content = pl.DataFrame(client.content.find(owner_guid=user_guid))
content
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another way we can approach this is by adding functionality to the SDK. What do you think?

client.users.find_one(prefix=username).content.find()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's pretty slick too. Might be more efficient to run this way as well, depending on how much content is on the server compared to the number of users.

@kmasiello kmasiello merged commit 950b4a7 into main Apr 27, 2024
@kmasiello kmasiello deleted the 11-recipe-list-all-content-by-a-userset-of-usersgroups branch April 27, 2024 00:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recipe: List all content by a user/set of users/groups
3 participants