Skip to content

Commit

Permalink
filter by namespace when available
Browse files Browse the repository at this point in the history
  • Loading branch information
pixl8-brayden committed Nov 21, 2024
1 parent c488116 commit e2d8074
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions handlers/admin/DataApiManager.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,15 @@ component extends="preside.system.base.AdminHandler" {
}

public void function queueListing( event, rc, prc ) {
var restUserQueryFilter = "subscribe_to_deletes = :trueValue OR subscribe_to_updates = :trueValue OR subscribe_to_inserts = :trueValue";
var restUserQueryParams = { trueValue={ type="cf_sql_bit", value=true } };

if ( Len( Trim( rc.apiRoute ?: "" ) ) && StructKeyExists( dataApiConfig, rc.apiRoute ) ) {
prc.filterNamespace = dataApiConfig[ rc.apiRoute ].dataApiNamespace ?: "";

restUserQueryFilter = "( #restUserQueryFilter# ) AND namespace = :namespace";
restUserQueryParams.namespace = prc.filterNamespace;

event.addAdminBreadCrumb(
title = translateResource( uri="cms:apiManager.configureauth.page.breadcrumbTitle", data=[ rc.apiRoute ] )
, link = event.buildAdminLink( linkTo = "apimanager.configureAuth", queryString="id=#rc.apiRoute#" )
Expand All @@ -209,8 +215,8 @@ component extends="preside.system.base.AdminHandler" {
prc.activeRestUser = rc.restUser ?: "";
prc.queueRestUsers = getPresideObject( "data_api_user_settings" ).selectData(
groupBy = "user.name"
, filter = "subscribe_to_deletes = :trueValue OR subscribe_to_updates = :trueValue OR subscribe_to_inserts = :trueValue"
, filterParams = { trueValue={ type="cf_sql_bit", value=true } }
, filter = restUserQueryFilter
, filterParams = restUserQueryParams
, selectFields = [ "user.id", "user.name" ]
);

Expand Down

0 comments on commit e2d8074

Please sign in to comment.