Providence application plugin that scopes collection hierarchy access 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.
- Expands each mapped root into its full descendant subtree.
- Validates collection parent assignment before insert and update.
- Rewrites hierarchy bundle lookup endpoints for both collection and object editors to subtree-filtered plugin endpoints.
- Filters collection autocomplete, hierarchy level loading, hierarchy ancestor loading and hierarchy sort operations to the allowed subtree.
- Filters mixed object+collection hierarchy browsing when
ca_objects_x_collections_hierarchy_enabledis enabled. - Blocks direct editor access to collections outside the allowed subtree.
- Blocks direct editor access to objects linked outside the allowed subtree.
- Blocks object creation/edit entry via
collection_idwhen the selected collection is outside the allowed subtree. - Adds clear user-facing errors in the editor when an invalid parent or collection context 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 currently applied in hierarchy bundle/lookup interactions and direct collection/object editor access.
- Object scope is determined from
ca_objects_x_collections_hierarchy_relationship_typewhen set; otherwise all related collections are considered. - If
ca_objects_x_collections_hierarchy_enabledis enabled, mixed object+collection hierarchy browsing is filtered by this plugin viaRestrictedObjectCollectionHierarchyController. - Collection/object search and browse screens are not yet subtree-filtered by this plugin; those flows will need a second pass because Providence does not expose a clean application-plugin hook at the point results are built.