Due to too many changes in the last time to the Build and Place system in Rust and too many implemented security restrictions, i decided to re-design the whole cupboard-sharing part of the plugin.
Before it worked all complete on a dynamic way, players were granted only temporary to access the cupboard area. This did not work anymore in a 100% way until a new hook was implemented.
But to avoid any future issues with coming system changes, it makes no sense to keep the system working like that.
The plugin does now add anyone how has shared rights physically to each cupboard whitelist, when the cupboard owner has enabled sharing and he is a friend or member of the clan.
For Friends(API), the removal of a friend works out of the box, the friend gets removed from each of the players cupboard whitelists.
For Clans, it works ONLY with ClansREBORN to remove players from each others cupboards, when a players got kicked, he left, or the clan was removed or disbanded. The public Clans version does miss the return of the needed informations to let it work with.
The sharing itself works with every Clans version.
The current code is tested as good as possible to guarantee the most possible user experience, but needs for sure some finetuning afterwards in small parts, which i did not see while testing/coding.