Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9702243

Browse files
committed
fixup some comments
1 parent 1be6aed commit 9702243

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

cli/server_createadminuser.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (r *RootCmd) newCreateAdminUserCommand() *serpent.Command {
176176
// Create the user.
177177
var newUser database.User
178178
err = db.InTx(func(tx database.Store) error {
179-
orgs, err := tx.GetOrganizations(ctx)
179+
orgs, err := tx.GetOrganizations(ctx, database.GetOrganizationsParams{})
180180
if err != nil {
181181
return xerrors.Errorf("get organizations: %w", err)
182182
}

coderd/idpsync/organization.go

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ type OrganizationParams struct {
3636
Organizations []uuid.UUID
3737
}
3838

39+
// SyncOrganizations if enabled will ensure the user is a member of the provided
40+
// organizations. It will add and remove their membership to match the expected set.
3941
func (s AGPLIDPSync) SyncOrganizations(ctx context.Context, tx database.Store, user database.User, params OrganizationParams) error {
4042
// Nothing happens if sync is not enabled
4143
if !params.SyncEnabled {

enterprise/coderd/enidpsync/organizations.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ func (e EnterpriseIDPSync) ParseOrganizationClaims(ctx context.Context, mergedCl
5858
}
5959

6060
return idpsync.OrganizationParams{
61-
SyncEnabled: true,
61+
// If the field is not set, then sync is not enabled.
62+
SyncEnabled: e.OrganizationField != "",
6263
IncludeDefault: e.OrganizationAssignDefault,
6364
Organizations: userOrganizations,
6465
}, nil

0 commit comments

Comments
 (0)