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

Method InsertProjectMemberUsergroup

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

Source from the content-addressed store, hash-verified

2516}
2517
2518func (c *connection) InsertProjectMemberUsergroup(ctx context.Context, groupID, projectID, roleID string, restrictResources bool, resources []database.ResourceName) error {
2519 resJSON, err := marshalResourceNames(resources)
2520 if err != nil {
2521 return err
2522 }
2523
2524 _, err = c.getDB(ctx).ExecContext(ctx, `
2525 INSERT INTO usergroups_projects_roles (usergroup_id, project_id, project_role_id, restrict_resources, resources) VALUES ($1, $2, $3, $4, $5)
2526 `, groupID, projectID, roleID, restrictResources, resJSON)
2527 if err != nil {
2528 return parseErr("project group member", err)
2529 }
2530 return nil
2531}
2532
2533func (c *connection) UpdateProjectMemberUsergroup(ctx context.Context, groupID, projectID, roleID string, restrictResources bool, resources []database.ResourceName) error {
2534 resJSON, err := marshalResourceNames(resources)

Callers

nothing calls this directly

Calls 4

getDBMethod · 0.95
marshalResourceNamesFunction · 0.85
parseErrFunction · 0.85
ExecContextMethod · 0.45

Tested by

no test coverage detected