Skip to content

Commit 79f9603

Browse files
committed
Remove the error translation for ACL checks for attribute writes
1 parent c13f3ce commit 79f9603

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/app/codegen-data-model/CodegenDataModel_Write.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ std::optional<CHIP_ERROR> TryWriteViaAccessInterface(const ConcreteAttributePath
5959

6060
CHIP_ERROR err = aai->Write(path, decoder);
6161

62-
// explict translate UnsupportedRead to Access denied. This is to allow callers to determine a
63-
// translation for this: usually wildcard subscriptions MAY just ignore these where as direct reads
64-
// MUST translate them to UnsupportedAccess
65-
ReturnErrorCodeIf(err == CHIP_IM_GLOBAL_STATUS(UnsupportedWrite), CHIP_ERROR_ACCESS_DENIED);
66-
6762
if (err != CHIP_NO_ERROR)
6863
{
6964
return std::make_optional(err);
@@ -74,6 +69,7 @@ std::optional<CHIP_ERROR> TryWriteViaAccessInterface(const ConcreteAttributePath
7469
// - if no encode, say that processing must continue
7570
return decoder.TriedDecode() ? std::make_optional(CHIP_NO_ERROR) : std::nullopt;
7671
}
72+
7773
/// Metadata of what a ember/pascal short string means (prepended by a u8 length)
7874
struct ShortPascalString
7975
{

src/app/data-model-interface/DataModel.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class DataModel : public DataModelMetadataTree
5858
/// TEMPORARY/TRANSITIONAL requirement for transitioning from ember-specific code
5959
/// ReadAttribute is REQUIRED to perform:
6060
/// - ACL validation (see notes on OperationFlags::kInternal)
61-
/// - Validation of readability/writability
61+
/// - Validation of readability/writability (also controlled by OperationFlags::kInternal)
6262
/// - use request.path.mExpanded to skip encoding replies for data according
6363
/// to 8.4.3.2 of the spec:
6464
/// > If the path indicates attribute data that is not readable, then the path SHALL
@@ -84,8 +84,10 @@ class DataModel : public DataModelMetadataTree
8484
/// When this is invoked, caller is expected to have already done some validations:
8585
/// - cluster `data version` has been checked for the incoming request if applicable
8686
///
87-
/// When `request.writeFlags.Has(WriteFlags::kForceInternal)` the request is from an internal app update
88-
/// and SHOULD bypass some internal checks (like timed enforcement, potentially read-only restrictions)
87+
/// TEMPORARY/TRANSITIONAL requirement for transitioning from ember-specific code
88+
/// WriteAttribute is REQUIRED to perform:
89+
/// - ACL validation (see notes on OperationFlags::kInternal)
90+
/// - Validation of readability/writability (also controlled by OperationFlags::kInternal)
8991
///
9092
/// Return codes
9193
/// CHIP_IM_GLOBAL_STATUS(code):

0 commit comments

Comments
 (0)