Various fixes.
This commit is contained in:
parent
4e4b77ca84
commit
02360be75b
20 changed files with 3137 additions and 3124 deletions
|
@ -226,7 +226,16 @@ async function remove(context, id) {
|
|||
await shares.enforceEntityPermissionTx(tx, context, 'namespace', id, 'delete');
|
||||
|
||||
const entityTypesWithNamespace = Object.keys(entitySettings.getEntityTypes());
|
||||
await dependencyHelpers.ensureNoDependencies(tx, context, id, entityTypesWithNamespace.map(entityTypeId => ({ entityTypeId: entityTypeId, column: 'namespace' })));
|
||||
|
||||
const depSpecs = entityTypesWithNamespace.map(entityTypeId => {
|
||||
if (entityTypeId === 'user') {
|
||||
return { entityTypeId: entityTypeId, column: 'namespace', viewPermission: {entityTypeId: 'namespace', entityId: id, requiredOperations: 'manageUsers'} };
|
||||
} else {
|
||||
return { entityTypeId: entityTypeId, column: 'namespace' };
|
||||
}
|
||||
});
|
||||
|
||||
await dependencyHelpers.ensureNoDependencies(tx, context, id, depSpecs);
|
||||
|
||||
await tx('namespaces').where('id', id).del();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue