posit-dev / posit-dev/connectapi

adding both a user and group to content requires two different functions

Open
#267 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
54
Forks
27
Avg merge
1d 3m
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing content_add_user and content_add_group and reviewing the linked connect-cookbook pull request for the two existing recipes. Determine how content_add_permission can accept either a user or group GUID and identify the relevant tests or examples to update; done means one function supports mixed principals without requiring separate lists.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.