adminizer 4.6.0-build.202 → 4.6.0-build.203
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/system/Router.d.ts +1 -1
- package/system/Router.js +4 -2
package/package.json
CHANGED
package/system/Router.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export default class Router {
|
|
|
10
10
|
*/
|
|
11
11
|
bind(): Promise<void>;
|
|
12
12
|
unbindModelRoutes(model: string): void;
|
|
13
|
-
bindModelRoutes(
|
|
13
|
+
bindModelRoutes(model: string, policies?: MiddlewareType[]): Promise<void>;
|
|
14
14
|
}
|
package/system/Router.js
CHANGED
|
@@ -132,7 +132,7 @@ export default class Router {
|
|
|
132
132
|
adminizer.app.get(`${adminizer.config.routePrefix}/get-timezones`, adminizer.policyManager.bindPolicies(policies, timezones));
|
|
133
133
|
if (adminizer.config.models) {
|
|
134
134
|
for (let model in adminizer.config.models) {
|
|
135
|
-
await this.bindModelRoutes(
|
|
135
|
+
await this.bindModelRoutes(model, policies);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
@@ -172,7 +172,9 @@ export default class Router {
|
|
|
172
172
|
this.modelRoutePatterns.delete(model);
|
|
173
173
|
Adminizer.log.debug(`Adminpanel removed routes for model \`${model}\`: ${removedPaths.join(', ')}`);
|
|
174
174
|
}
|
|
175
|
-
async bindModelRoutes(
|
|
175
|
+
async bindModelRoutes(model, policies) {
|
|
176
|
+
if (!policies)
|
|
177
|
+
policies = this.adminizer.config.policies;
|
|
176
178
|
if (this.modelRoutePatterns.has(model)) {
|
|
177
179
|
this.unbindModelRoutes(model);
|
|
178
180
|
}
|