@@ -611,6 +611,12 @@ func (q *fakeQuerier) GetAuthorizedUserCount(ctx context.Context, params databas
611
611
q .mutex .RLock ()
612
612
defer q .mutex .RUnlock ()
613
613
614
+ // Call this to match the same function calls as the SQL implementation.
615
+ _ ,err := prepared .CompileToSQL (ctx ,rbac .ConfigWithoutACL ())
616
+ if err != nil {
617
+ return nil ,err
618
+ }
619
+
614
620
users := make ([]database.User ,0 ,len (q .users ))
615
621
616
622
for _ ,user := range q .users {
@@ -889,6 +895,7 @@ func (q *fakeQuerier) GetAuthorizedWorkspaces(ctx context.Context, arg database.
889
895
q .mutex .RLock ()
890
896
defer q .mutex .RUnlock ()
891
897
898
+ // Call this to match the same function calls as the SQL implementation.
892
899
_ ,err := prepared .CompileToSQL (ctx ,rbac .ConfigWithoutACL ())
893
900
if err != nil {
894
901
return nil ,err
@@ -1700,6 +1707,12 @@ func (q *fakeQuerier) GetAuthorizedTemplates(ctx context.Context, arg database.G
1700
1707
q .mutex .RLock ()
1701
1708
defer q .mutex .RUnlock ()
1702
1709
1710
+ // Call this to match the same function calls as the SQL implementation.
1711
+ _ ,err := prepared .CompileToSQL (ctx ,rbac .ConfigWithoutACL ())
1712
+ if err != nil {
1713
+ return nil ,err
1714
+ }
1715
+
1703
1716
var templates []database.Template
1704
1717
for _ ,template := range q .templates {
1705
1718
if prepared != nil && prepared .Authorize (ctx ,template .RBACObject ())!= nil {