diff --git a/src/app/clusters/access-control-server/access-control-server.cpp b/src/app/clusters/access-control-server/access-control-server.cpp index 19b17d4406093f..b22911e56c5c8c 100644 --- a/src/app/clusters/access-control-server/access-control-server.cpp +++ b/src/app/clusters/access-control-server/access-control-server.cpp @@ -579,9 +579,27 @@ CHIP_ERROR AccessControlAttribute::WriteExtension(AttributeValueDecoder & aDecod AccessControlAttribute gAttribute; +class : public FabricTableDelegate +{ +public: + void OnFabricDeletedFromStorage(CompressedFabricId compressedId, FabricIndex fabricIndex) override + { + auto & storage = Server::GetInstance().GetPersistentStorage(); + DefaultStorageKeyAllocator key; + storage.SyncDeleteKeyValue(key.AccessControlExtensionEntry(fabricIndex)); + } + void OnFabricRetrievedFromStorage(FabricInfo * fabricInfo) override {} + void OnFabricPersistedToStorage(FabricInfo * fabricInfo) override {} + +} fabricTableDelegate; + } // namespace void MatterAccessControlPluginServerInitCallback() { + ChipLogProgress(DataManagement, "AccessControlCluster: initializing"); + registerAttributeAccessOverride(&gAttribute); + + Server::GetInstance().GetFabricTable().AddFabricDelegate(&fabricTableDelegate); }