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

Commitb4beb38

Browse files
committed
Call compileToSQL in getWorkspaces
1 parentf45a170 commitb4beb38

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎coderd/database/databasefake/databasefake.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,12 @@ func (q *fakeQuerier) GetAuthorizedUserCount(ctx context.Context, params databas
611611
q.mutex.RLock()
612612
deferq.mutex.RUnlock()
613613

614+
// Call this to match the same function calls as the SQL implementation.
615+
_,err:=prepared.CompileToSQL(ctx,rbac.ConfigWithoutACL())
616+
iferr!=nil {
617+
returnnil,err
618+
}
619+
614620
users:=make([]database.User,0,len(q.users))
615621

616622
for_,user:=rangeq.users {
@@ -889,6 +895,7 @@ func (q *fakeQuerier) GetAuthorizedWorkspaces(ctx context.Context, arg database.
889895
q.mutex.RLock()
890896
deferq.mutex.RUnlock()
891897

898+
// Call this to match the same function calls as the SQL implementation.
892899
_,err:=prepared.CompileToSQL(ctx,rbac.ConfigWithoutACL())
893900
iferr!=nil {
894901
returnnil,err
@@ -1700,6 +1707,12 @@ func (q *fakeQuerier) GetAuthorizedTemplates(ctx context.Context, arg database.G
17001707
q.mutex.RLock()
17011708
deferq.mutex.RUnlock()
17021709

1710+
// Call this to match the same function calls as the SQL implementation.
1711+
_,err:=prepared.CompileToSQL(ctx,rbac.ConfigWithoutACL())
1712+
iferr!=nil {
1713+
returnnil,err
1714+
}
1715+
17031716
vartemplates []database.Template
17041717
for_,template:=rangeq.templates {
17051718
ifprepared!=nil&&prepared.Authorize(ctx,template.RBACObject())!=nil {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp