# General hook for ModelStorage modification

**URL:** https://discuss.tryton.org/t/general-hook-for-modelstorage-modification/8210
**Category:** Feature
**Created:** [January 17, 2025, 5:23pm UTC](https://discuss.tryton.org/t/general-hook-for-modelstorage-modification/8210 "2025-01-17T17:23:56Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [March 1, 2025, 12:28am UTC](https://discuss.tryton.org/t/general-hook-for-modelstorage-modification/8210/6 "2025-03-01T00:28:09Z")

</div>

> [@ced](#):
>
> `check_modification(cls, records, values=None)` which is called only by `ModelStorage.write` and `ModelStorage.delete` at the beginning.

We have some checks that are only to be enforced for external user and other checks that should always be enforced for data integrity.  
So I think we should follow the proposal of [Verify access right only for RPC](https://discuss.tryton.org/t/verify-access-right-only-for-rpc/8123) and have this API:

- `check_modification(cls, records, values=None, external=False)` which is called without check access but `external` is set to `True` when check access is `True`.

---

_[View the full topic](https://discuss.tryton.org/t/general-hook-for-modelstorage-modification/8210)._
