# rsc\_gone

Source: https://zotonic.com/docs/1286/rsc_gone

URI: https://zotonic.com/id/1286

Language: en



This model tracks deleted resources (see <a href="/id/doc_model_model_rsc" class="doc-reference doc-reference-model"><code>model#rsc</code></a>). Its primary goal is to be able to determine if a resource never existed, has been deleted or has been replaced by another resource.

Information kept
----------------

Only very basic information of the deleted resource is kept in the `rsc_gone` table. It is enough for referring to a new location, giving correct errors or to determine who deleted a resource.

The saved category, content group, visibility and ownership fields are used for an ACL filter on the deleted-pages overview.

Display labels are kept in `props_json`; complete resource data remains in <a href="/id/doc_module_mod_backup" class="doc-reference doc-reference-module"><code>module#mod_backup</code></a> revisions. Restoring a resource removes its tombstone. `props_json.deletion_reason` distinguishes manual deletion from automatic dependent cleanup. Imports respect manual deletion; dependent resources can be imported again if referenced. Legacy tombstones without a reason are treated as manual deletions. Only category/content-group labels are copied. `props_json.deleter_id` identifies the deletion actor; person titles are read from live resources through the normal ACL checks.

The public model paths below expose only routing information. Reading archived metadata requires admin access plus update permission on the saved ACL fields (`is_editable/2`). ACL modules implement `view_deleted` on an `acl_rsc` snapshot and `acl_rsc_gone_sql` for SQL filtering; unsupported modules fail closed. Legacy metadata is populated in resumable background batches by `mod_backup`.

Properties
----------

Whenever a resource is deleted through <a href="/id/doc_model_model_rsc" class="doc-reference doc-reference-model"><code>model#rsc</code></a>, some information from that resource is copied to the `rsc_gone` table.

The following properties are saved:

| Property          | Description                                                                      | Example value                      |
| ----------------- | -------------------------------------------------------------------------------- | ---------------------------------- |
| id                | Id of the resource, an integer.                                                  | `42`                               |
| new\_id           | If the resource is replaced by another resource then this is the id of that other resource. | `341`                              |
| new\_uri          | If the resource is moved to another place on the web then this is the uri of the new location. | `<<"<http://example.com/hello>">>` |
| name              | The name (if any) of the deleted resource.                                       | `<<"page_hello">>`                 |
| uri               | The uri of the authoritative source for the resource.                            | `<<"<http://foo.bar/hello>">>`     |
| page\_path        | The page path (if any) of the deleted resource.                                  | `<<"/hello">>`                     |
| is\_authoritative | Whether the resource originated on this site or was imported and maintained on another site. Return a boolean. | `true`                             |
| creator\_id       | The id of the creator of the deleted resource.                                   | `1`                                |
| created           | The date the deleted resource was created.                                       | `{{2008,12,10},{15,30,00}}`        |
| modifier\_id      | The id of the user that deleted the resource.                                    | `2718`                             |
| modified          | The date the resource was deleted.                                               | `{{2012,12,5},{23,59,59}}`         |

Available Model API Paths
-------------------------

| Method | Path pattern            | Description                                                                      |
| ------ | ----------------------- | -------------------------------------------------------------------------------- |
| `get`  | `/+id/new_location/...` | Return category data for +id. Uses `get_new_location`.                           |
| `get`  | `/+id/is_gone/...`      | Return whether gone (`is_gone`).                                                 |
| `get`  | `/+id/followup/...`     | Resolve a live local resource, following replacement IDs. Does not authorize access to its properties. |

`/+name` marks a variable path segment. A trailing `/...` means extra path segments are accepted for further lookups.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1286?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1286?language=en>)
