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

adding both a user and group to content requires two method calls #194

Open
kmasiello opened this issue May 21, 2024 · 0 comments
Open

adding both a user and group to content requires two method calls #194

kmasiello opened this issue May 21, 2024 · 0 comments
Labels
enhancement New feature or request sdk Used for automation

Comments

@kmasiello
Copy link

To add a user or group, the "principal_type" of "user" or "group" is required as an input. Examples:

Add user:

client.content.get(content_guid).permissions.create(
    principal_guid=user_guid,
    principal_type="user",
    role=access_type,
    )

Add a group:

client.content.get(content_guid).permissions.create(
    principal_guid=group_guid,
    principal_type="group",
    role=access_type,
    )

A common use case may be to have a list of users and groups to add to content, however, the current implementation requires that list to be segregated by users and groups. A cleaner implementation would allow .permissions.create to take either a user or a group guid and then sort out internally what type of principal it is.

See posit-dev/connect-cookbook#65 for how this requires two different recipes to do more or less the same thing.

@tdstein tdstein added the enhancement New feature or request label May 28, 2024
@tdstein tdstein added the sdk Used for automation label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sdk Used for automation
Projects
None yet
Development

No branches or pull requests

2 participants