diff --git a/src/access/AccessControl.cpp b/src/access/AccessControl.cpp index 9b3278d5b1a2cd..6c98504cb59eee 100644 --- a/src/access/AccessControl.cpp +++ b/src/access/AccessControl.cpp @@ -83,6 +83,9 @@ CHIP_ERROR AccessControl::Finish() CHIP_ERROR AccessControl::Check(const SubjectDescriptor & subjectDescriptor, const RequestPath & requestPath, Privilege requestPrivilege) { + // During development, allow access if delegate is transitional + ReturnErrorCodeIf(mDelegate.IsTransitional(), CHIP_NO_ERROR); + EntryIterator iterator; ReturnErrorOnFailure(Entries(iterator, &subjectDescriptor.fabricIndex)); diff --git a/src/access/AccessControl.h b/src/access/AccessControl.h index c11bb44c2d09ca..d99dc6d512534e 100644 --- a/src/access/AccessControl.h +++ b/src/access/AccessControl.h @@ -319,6 +319,9 @@ class AccessControl return CHIP_ERROR_NOT_IMPLEMENTED; } + // Transitional (during development, will be removed later) + virtual bool IsTransitional() const { return true; } + // Listening virtual void SetListener(Listener & listener) { mListener = &listener; } virtual void ClearListener() { mListener = nullptr; } diff --git a/src/access/examples/ExampleAccessControlDelegate.cpp b/src/access/examples/ExampleAccessControlDelegate.cpp index 72d1518febc485..f5fe6bcc02f975 100644 --- a/src/access/examples/ExampleAccessControlDelegate.cpp +++ b/src/access/examples/ExampleAccessControlDelegate.cpp @@ -1081,6 +1081,8 @@ class AccessControlDelegate : public AccessControl::Delegate return CHIP_ERROR_BUFFER_TOO_SMALL; } + bool IsTransitional() const override { return false; } + private: CHIP_ERROR LoadFromFlash() { return CHIP_NO_ERROR; }