Skip to content

Commit

Permalink
Merge 0f5bcfc into e5c39d4
Browse files Browse the repository at this point in the history
  • Loading branch information
mlepage-google authored Mar 26, 2022
2 parents e5c39d4 + 0f5bcfc commit 1030910
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/access/AccessControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,22 @@ CHIP_ERROR AccessControl::Finish()
return retval;
}

CHIP_ERROR AccessControl::RemoveFabric(FabricIndex fabricIndex)
{
ChipLogProgress(DataManagement, "AccessControl: removing fabric %u", fabricIndex);

CHIP_ERROR err;
do
{
err = DeleteEntry(0, &fabricIndex);
} while (err == CHIP_NO_ERROR);

// Sentinel error is OK, just means there was no such entry.
ReturnErrorCodeIf(err != CHIP_ERROR_SENTINEL, err);

return CHIP_NO_ERROR;
}

CHIP_ERROR AccessControl::Check(const SubjectDescriptor & subjectDescriptor, const RequestPath & requestPath,
Privilege requestPrivilege)
{
Expand Down
2 changes: 2 additions & 0 deletions src/access/AccessControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ class AccessControl
return mDelegate->DeleteEntry(index, fabricIndex);
}

CHIP_ERROR RemoveFabric(FabricIndex fabricIndex);

/**
* Iterates over entries in the access control list.
*
Expand Down
1 change: 1 addition & 0 deletions src/app/server/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ class Server
{
groupDataProvider->RemoveFabric(fabricIndex);
}
Access::GetAccessControl().RemoveFabric(fabricIndex);
};
void OnFabricRetrievedFromStorage(FabricInfo * fabricInfo) override { (void) fabricInfo; }

Expand Down

0 comments on commit 1030910

Please sign in to comment.