# mod\_admin\_predicate

Source: https://zotonic.com/docs/1921/mod_admin_predicate

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

Language: en



Add support for editing [predicates](/id/doc_userguide_datamodel#guide-datamodel-edge-predicates) in the admin, by presenting a list of all defined predicates on `http://yoursite.com/admin/predicate`.

Predicates can be added, removed and edited, just like regular [resources](/id/doc_glossary#term-resource).

ACL permissions
---------------

The following [ACL permissions](/id/doc_developerguide_access_control#guide-authorization) are required:

- to view the page, the `use` permission on the ‘mod\_admin\_predicate’ module; see <a href="/id/doc_module_mod_acl_user_groups" class="doc-reference doc-reference-module"><code>module#mod_acl_user_groups</code></a>
- to edit and delete predicates, `edit` and `delete` permissions on category ‘predicate’; see <a href="/id/doc_module_mod_acl_user_groups" class="doc-reference doc-reference-module"><code>module#mod_acl_user_groups</code></a>. Admin module for managing edge predicates and predicate resources in the backend.

Accepted Events
---------------

This module handles the following notifier callbacks:

- `observe_admin_menu`: Add predicate management entries to the admin menu.
- `observe_rsc_delete`: Do not allow a predicate to be removed iff there are edges with that predicate using `m_predicate:is_used`.
- `observe_rsc_update`: Check if the update contains information for a predicate using `m_predicate:update_noflush`.
- `observe_rsc_update_done`: Whenever a predicate has been updated we have to flush the predicate cache using `m_predicate:flush`.
- `observe_search_query`: Implement predicate-specific search query clauses used by admin predicate listings.

Delegate callbacks:

- `event/2` with `postback` messages: `delete_all`.
- `event/2` with `submit` messages: `delete_move`.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1921?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/1921?language=en>)
