Providence application plugin that enforces collection parent assignment rules based on user role and user ID mapping.
- Optionally gates checks by required role (for example,
cataloguer). - Maps user IDs to allowed root collection IDs.
- Validates collection parent assignment before insert and update.
- Rewrites collection hierarchy bundle lookup endpoints to subtree-filtered plugin endpoints.
- Filters collection autocomplete, hierarchy level loading, hierarchy ancestor loading and hierarchy sort operations to the allowed subtree.
- Adds clear user-facing errors in the editor when an invalid parent is selected.
Edit:
app/plugins/groupCollectionRootMap/conf/plugin.conf
Settings:
enable:1to enable.required_role: rolename,code, oridrequired for checks to apply.bypass_for_administrators: if1, administrators bypass restrictions.require_mapping_for_all_users: if1, required-role users with no user mapping are blocked.allow_root_parent_assignment: if1, top-level parent assignment is allowed.user_root_collection_map: user_id to root collection ID list.
Default plugin.conf values are intentionally safe/no-op for source control (enable = 0, empty mapping). Set real values in plugin.local.conf on the server.
To avoid re-editing after deploy syncs:
- Keep deploy defaults in
conf/plugin.conf. - Create
conf/plugin.local.confon the server (fromconf/plugin.local.conf.example). - Put environment-specific values (especially
user_root_collection_map) inplugin.local.conf.
If present, plugin.local.conf keys override plugin.conf keys.
For rsync, exclude the server-local file from deploys:
rsync ... --exclude='app/plugins/groupCollectionRootMap/conf/plugin.local.conf' ...Example:
required_role = cataloguer
user_root_collection_map = {
12 = [101],
34 = [202, 203]
}
- No theme changes are required.
- For invalid creates, the plugin blocks insert and reports an explicit message.
- For invalid updates, the plugin preserves the existing parent and reports an explicit message.
- Visibility filtering is applied in collection hierarchy bundle/lookup interactions.
- If
ca_objects_x_collections_hierarchy_enabledis enabled, mixed object+collection hierarchy browsing is filtered by this plugin viaRestrictedObjectCollectionHierarchyController.