Strong types everywhere.
MODIFY
src/server/rest/v1/service/AuthorizationService.ts
src/server/rest/v1/service/AuthorizationService.ts
@@ -74,7 +74,7 @@ export default class AuthorizationService {
}
public static async addSiteAuthorizations(tenant: Tenant, userToken: UserToken, site: Site, authorizationFilter: AuthorizationFilter,
- filteredRequest: Record<string, any>): Promise<void> {
+ filteredRequest: Partial<HttpSitesRequest>): Promise<void> {
// Enrich
if (!site.issuer) {
site.canRead = true;
@@ -327,7 +327,7 @@ export default class AuthorizationService {
}
public static async checkAndGetUsersAuthorizationFilters(tenant: Tenant, userToken: UserToken,
- filteredRequest: Record<string, any>): Promise<AuthorizationFilter> {
+ filteredRequest?: HttpUsersRequest): Promise<AuthorizationFilter> {
const authorizationFilters: AuthorizationFilter = {
filters: {},
dataSources: new Map(),

MODIFY
src/server/rest/v1/service/UtilsService.ts
src/server/rest/v1/service/UtilsService.ts
@@ -108,7 +108,7 @@ export default class UtilsService {
public static async checkAndGetUsersAuthorization(tenant: Tenant, userToken: UserToken, action: ServerAction,
additionalFilters: Record<string, any>, applyProjectFields = false): Promise<User[]> {
// Check dynamic auth
- const authorizationFilter = await AuthorizationService.checkAndGetUsersAuthorizationFilters(tenant, userToken, {});
+ const authorizationFilter = await AuthorizationService.checkAndGetUsersAuthorizationFilters(tenant, userToken);
if (!authorizationFilter.authorized) {
throw new AppAuthError({
errorCode: HTTPAuthError.FORBIDDEN,

Strong types everywhere.