connectapi
connectapi copied to clipboard
adding both a user and group to content requires two different functions
To add a user or group to content, two different functions are required Examples:
Add user:
content_add_user(content, user_guid, role = access_type)
Add a group:
content_add_group(content, group_guid, 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 content_add_permission
to take either a user or a group guid and then sort out internally what type of principal it is.
See https://github.com/posit-dev/connect-cookbook/pull/65 for how this requires two different recipes to do more or less the same thing.