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

Method UpdateProjectMemberUserRole

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

Source from the content-addressed store, hash-verified

2561}
2562
2563func (c *connection) UpdateProjectMemberUserRole(ctx context.Context, projectID, userID, roleID string, restrictResources bool, resources []database.ResourceName) error {
2564 resJSON, err := marshalResourceNames(resources)
2565 if err != nil {
2566 return err
2567 }
2568
2569 res, err := c.getDB(ctx).ExecContext(ctx, `UPDATE users_projects_roles SET project_role_id = $1, restrict_resources = $4, resources = $5 WHERE user_id = $2 AND project_id = $3`, roleID, userID, projectID, restrictResources, resJSON)
2570 return checkUpdateRow("project member", res, err)
2571}
2572
2573// UpsertProjectMemberServiceRole inserts or updates the role of a service in a project
2574func (c *connection) UpsertProjectMemberServiceRole(ctx context.Context, serviceID, projectID, roleID string) error {

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