Hello!
We’ve been investigating ways to introduce context-based source control restrictions for developers. For example, Person on Team A needs to be able to see assets owned by Team B, but shouldn’t be able to edit/modify those assets.
Post-Save validation can throw errors when improper edits are saved, but the save itself isn’t prevented meaning that this is much less of a guardrail than we really need it to be. I also tested adding DenyListItems to the WritableFolderPermissionList, but unfortunately the assets being literally read-only also prevents opening/previewing the assets in most cases (apart from textures and static meshes).
Are there any built-in mechanisms or hooks to use in order to create pre-save validation checks?
Thanks!
Jonathan
Hi,
You could possibly use the UPackage::FPreSavePackage UPackage::PreSavePackageEvent;? It is used in few place in the engine. Would it work.
Regards,
Patrick
Interesting, especially the adjacent FOnPackageDirtyStateChanged delegate. So rather than trying to block the save operation we could instead flag users when an improper asset is initially marked as dirty. That might be ideal, as it would reduce the risk of work loss by blocking users the first time they attempt to make any changes.
Thanks!
Hi,
You could probably take a look at \Engine\Source\Developer\UnsavedAssetsTracker\Source\Private\UnsavedAssetsTracker.cpp, this is the code used to display the Editor toolbar (at the bottom right). It tracks when an savable asset gets dirty.
[Image Removed]Regards,
Patrick