Skip to content

Commit 29655e5

Browse files
committed
pr comments
1 parent b3f76bb commit 29655e5

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-
return q.db.GetUnexpiredLicenses(ctx)
3045+
if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceLicense); err != nil {
3046+
return nil, err
30473047
}
3048-
return fetchWithPostFilter(q.auth, policy.ActionRead, fetch)(ctx, nil)
3048+
return q.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-
var mErr error
166+
var errs []error
167167
for _, closer := range m.closers {
168168
if err := 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-
return mErr
172+
return errors.Join(errs...)
173173
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy