Skip to content

Commit 32c8af1

Browse files
committed
activitybump: use systemCtx for activityBumpWorkspace
1 parent 467646d commit 32c8af1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

coderd/activitybump.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import (
1010
"golang.org/x/xerrors"
1111

1212
"cdr.dev/slog"
13+
"github.com/coder/coder/coderd/authzquery"
1314
"github.com/coder/coder/coderd/database"
15+
"github.com/coder/coder/coderd/rbac"
1416
)
1517

1618
// activityBumpWorkspace automatically bumps the workspace's auto-off timer
@@ -19,6 +21,8 @@ func activityBumpWorkspace(log slog.Logger, db database.Store, workspaceID uuid.
1921
// We set a short timeout so if the app is under load, these
2022
// low priority operations fail first.
2123
ctx, cancel := context.WithTimeout(context.Background(), time.Second*15)
24+
// We always want to use the **system** authz context for this.
25+
ctx = authzquery.WithAuthorizeSystemContext(ctx, rbac.RolesAdminSystem())
2226
defer cancel()
2327

2428
err := db.InTx(func(s database.Store) error {

0 commit comments

Comments
 (0)