adminizer 4.1.0-build.32 → 4.1.0-build.33
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.
|
@@ -10,10 +10,10 @@ export class AccessRightsHelper {
|
|
|
10
10
|
if (!accessRightsToken.id || !accessRightsToken.name || !accessRightsToken.description || !accessRightsToken.department) {
|
|
11
11
|
throw new Error("Adminpanel > Can not register token: Missed one or more required parameters");
|
|
12
12
|
}
|
|
13
|
-
for (let
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
for (let i = 0; i < this._tokens.length; i++) {
|
|
14
|
+
if (this._tokens[i].id === accessRightsToken.id) {
|
|
15
|
+
this._tokens.splice(i, 1);
|
|
16
|
+
break;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
this._tokens.push(accessRightsToken);
|
|
@@ -3,9 +3,6 @@ export class ModelHandler {
|
|
|
3
3
|
models = new Map();
|
|
4
4
|
add(modelName, modelInstance) {
|
|
5
5
|
const modelname = modelName.toLowerCase();
|
|
6
|
-
if (this.models.has(modelname)) {
|
|
7
|
-
throw new Error(`Model "${modelname}" is already registered.`);
|
|
8
|
-
}
|
|
9
6
|
this.models.set(modelname, modelInstance);
|
|
10
7
|
Adminizer.log.debug(`Model with name [${modelname}] was registered`);
|
|
11
8
|
}
|