Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit29655e5

Browse files
committed
pr comments
1 parentb3f76bb commit29655e5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

‎coderd/database/dbauthz/dbauthz.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,10 +3042,10 @@ func (q *querier) GetTemplatesWithFilter(ctx context.Context, arg database.GetTe
30423042
}
30433043

30443044
func (q*querier)GetUnexpiredLicenses(ctx context.Context) ([]database.License,error) {
3045-
fetch:=func(ctx context.Context,_interface{}) ([]database.License,error) {
3046-
returnq.db.GetUnexpiredLicenses(ctx)
3045+
iferr:=q.authorizeContext(ctx,policy.ActionRead,rbac.ResourceLicense);err!=nil {
3046+
returnnil,err
30473047
}
3048-
returnfetchWithPostFilter(q.auth,policy.ActionRead,fetch)(ctx,nil)
3048+
returnq.db.GetUnexpiredLicenses(ctx)
30493049
}
30503050

30513051
func (q*querier)GetUserActivityInsights(ctx context.Context,arg database.GetUserActivityInsightsParams) ([]database.GetUserActivityInsightsRow,error) {

‎coderd/database/dbauthz/dbauthz_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ func (s *MethodTestSuite) TestLicense() {
767767
db.EXPECT().GetUnexpiredLicenses(gomock.Any()).
768768
Return([]database.License{l},nil).
769769
AnyTimes()
770-
check.Args().Asserts(l,policy.ActionRead).
770+
check.Args().Asserts(rbac.ResourceLicense,policy.ActionRead).
771771
Returns([]database.License{l})
772772
}))
773773
s.Run("InsertLicense",s.Subtest(func(db database.Store,check*expects) {

‎enterprise/cli/server.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ func (m *multiCloser) Add(closer io.Closer) {
163163
}
164164

165165
func (m*multiCloser)Close()error {
166-
varmErrerror
166+
varerrs []error
167167
for_,closer:=rangem.closers {
168168
iferr:=closer.Close();err!=nil {
169-
mErr=xerrors.Errorf("close %T: %w",closer,err)
169+
errs=append(errs,xerrors.Errorf("close %T: %w",closer,err))
170170
}
171171
}
172-
returnmErr
172+
returnerrors.Join(errs...)
173173
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp