mirror of
https://github.com/standardnotes/server
synced 2026-09-21 06:13:09 -04:00
fix: item deletion
This commit is contained in:
@@ -265,12 +265,12 @@ export class ServerContainerConfigLoader extends CommonContainerConfigLoader {
|
||||
.bind<ItemSaveValidatorInterface>(TYPES.ItemSaveValidator)
|
||||
.toDynamicValue((context: interfaces.Context) => {
|
||||
return new ItemSaveValidator([
|
||||
context.container.get(TYPES.SnjsVersionFilter),
|
||||
context.container.get(TYPES.OwnershipFilter),
|
||||
context.container.get(TYPES.TimeDifferenceFilter),
|
||||
context.container.get(TYPES.UuidFilter),
|
||||
context.container.get(TYPES.ContentTypeFilter),
|
||||
context.container.get(TYPES.ContentFilter),
|
||||
context.container.get(TYPES.SnjsVersionFilter),
|
||||
])
|
||||
})
|
||||
|
||||
|
||||
@@ -51,7 +51,10 @@ export class OwnershipFilter implements ItemSaveRuleInterface {
|
||||
|
||||
const isItemBeingRemovedFromGroup =
|
||||
dto.existingItem != null && dto.existingItem.groupUuid != null && dto.itemHash.group_uuid == null
|
||||
if (isItemBeingRemovedFromGroup) {
|
||||
|
||||
const isItemBeingDeleted = dto.itemHash.deleted === true
|
||||
|
||||
if (isItemBeingRemovedFromGroup || isItemBeingDeleted) {
|
||||
return groupAuthorization === 'admin' ? successValue : groupReadonlyFail
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user