Adding user defined portfolio locking.

Added user defined locking at the assignment level. The default value is controlled by the admin at the plugin's config.

This code is dependent to the `improved_library` code at the dependent local plugin.