MCPcopy Create free account
hub / github.com/rilldata/rill / UpdateProjectMemberUsergroup

Method UpdateProjectMemberUsergroup

admin/database/postgres/postgres.go:2533–2543  ·  view source on GitHub ↗
(ctx context.Context, groupID, projectID, roleID string, restrictResources bool, resources []database.ResourceName)

Source from the content-addressed store, hash-verified

2531}
2532
2533func (c *connection) UpdateProjectMemberUsergroup(ctx context.Context, groupID, projectID, roleID string, restrictResources bool, resources []database.ResourceName) error {
2534 resJSON, err := marshalResourceNames(resources)
2535 if err != nil {
2536 return err
2537 }
2538
2539 res, err := c.getDB(ctx).ExecContext(ctx, `
2540 UPDATE usergroups_projects_roles SET project_role_id = $3, restrict_resources = $4, resources = $5 WHERE usergroup_id = $1 AND project_id = $2
2541 `, groupID, projectID, roleID, restrictResources, resJSON)
2542 return checkUpdateRow("project group member", res, err)
2543}
2544
2545func (c *connection) DeleteProjectMemberUsergroup(ctx context.Context, groupID, projectID string) error {
2546 res, err := c.getDB(ctx).ExecContext(ctx, "DELETE FROM usergroups_projects_roles WHERE usergroup_id = $1 AND project_id = $2", groupID, projectID)

Callers

nothing calls this directly

Calls 4

getDBMethod · 0.95
marshalResourceNamesFunction · 0.85
checkUpdateRowFunction · 0.85
ExecContextMethod · 0.45

Tested by

no test coverage detected