From 374fa2dea03d2124a37aee5beb25b262324d63c7 Mon Sep 17 00:00:00 2001 From: cecille Date: Mon, 16 Dec 2024 15:27:50 -0500 Subject: [PATCH] Scenes management: Fix access on CopyScene --- .../all-clusters-common/all-clusters-app.matter | 2 +- .../all-clusters-common/all-clusters-minimal-app.matter | 2 +- .../chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter | 2 +- .../light-switch-common/icd-lit-light-switch-app.matter | 2 +- .../light-switch-common/light-switch-app.matter | 2 +- examples/light-switch-app/qpg/zap/switch.matter | 2 +- .../lighting-common/lighting-app.matter | 2 +- examples/lighting-app/lighting-common/lighting-app.matter | 2 +- .../lighting-app/silabs/data_model/lighting-thread-app.matter | 2 +- .../lighting-app/silabs/data_model/lighting-wifi-app.matter | 2 +- examples/placeholder/linux/apps/app1/config.matter | 2 +- examples/placeholder/linux/apps/app2/config.matter | 2 +- .../virtual-device-common/virtual-device-app.matter | 2 +- .../zap/tests/outputs/all-clusters-app/app-templates/access.h | 3 +++ .../zap/tests/outputs/lighting-app/app-templates/access.h | 3 +++ src/app/zap-templates/zcl/data-model/chip/scene.xml | 1 + src/controller/data_model/controller-clusters.matter | 2 +- 17 files changed, 21 insertions(+), 14 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 7c102c16a7f8f8..0c5b55d33a9ef5 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4010,7 +4010,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** Attributes and commands for monitoring HEPA filters in a device */ diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 7535cc85af85c3..e7c61c1c308a05 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -2879,7 +2879,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** An interface to a generic way to secure a door */ diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter index e00c0f23bcbefd..b2c67e9c9a4a4b 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter @@ -1908,7 +1908,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** The server cluster provides an interface to occupancy sensing functionality based on one or more sensing modalities, including configuration and provision of notifications of occupancy status. */ diff --git a/examples/light-switch-app/light-switch-common/icd-lit-light-switch-app.matter b/examples/light-switch-app/light-switch-common/icd-lit-light-switch-app.matter index e1b1b1c02acdd6..2e3827d9ae2268 100644 --- a/examples/light-switch-app/light-switch-common/icd-lit-light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/icd-lit-light-switch-app.matter @@ -2438,7 +2438,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** Attributes and commands for controlling the color properties of a color-capable light. */ diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 1f6ab1adb4f490..b50c93ec27d357 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -2438,7 +2438,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** Attributes and commands for controlling the color properties of a color-capable light. */ diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter index abda431dfd7b2f..2eb47604f38781 100644 --- a/examples/light-switch-app/qpg/zap/switch.matter +++ b/examples/light-switch-app/qpg/zap/switch.matter @@ -2555,7 +2555,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** Attributes and commands for controlling the color properties of a color-capable light. */ diff --git a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter index 04ab7da351f72e..4c7e31646de0fa 100644 --- a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter +++ b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter @@ -2246,7 +2246,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** Attributes and commands for controlling the color properties of a color-capable light. */ diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 564c7b7da136c8..53f31a35e85a38 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -2246,7 +2246,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** Attributes and commands for controlling the color properties of a color-capable light. */ diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 71ba27726a90b7..7a2429dad1428c 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -1950,7 +1950,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** Attributes and commands for controlling the color properties of a color-capable light. */ diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index 1337f490e1963b..83614e8cc918d7 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -2241,7 +2241,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** Attributes and commands for controlling the color properties of a color-capable light. */ diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 6225040b695cb6..f8544c04c07c2c 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -3514,7 +3514,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** An interface to a generic way to secure a door */ diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 65f851a8154731..8daeb82a6f1e71 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -3471,7 +3471,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** An interface to a generic way to secure a door */ diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index 1285d14cce1cd8..ad1da15819866d 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -2354,7 +2354,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** An interface to a generic way to secure a door */ diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h index a7105de53d00b5..8e2e0ca373a86c 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h @@ -401,6 +401,7 @@ 0x00000062, /* Cluster: Scenes Management, Command: RemoveScene, Privilege: manage */ \ 0x00000062, /* Cluster: Scenes Management, Command: RemoveAllScenes, Privilege: manage */ \ 0x00000062, /* Cluster: Scenes Management, Command: StoreScene, Privilege: manage */ \ + 0x00000062, /* Cluster: Scenes Management, Command: CopyScene, Privilege: manage */ \ 0x00000201, /* Cluster: Thermostat, Command: AtomicRequest, Privilege: manage */ \ 0xFFF1FC06, /* Cluster: Fault Injection, Command: FailAtFault, Privilege: manage */ \ 0xFFF1FC06, /* Cluster: Fault Injection, Command: FailRandomlyAtFault, Privilege: manage */ \ @@ -452,6 +453,7 @@ 0x00000002, /* Cluster: Scenes Management, Command: RemoveScene, Privilege: manage */ \ 0x00000003, /* Cluster: Scenes Management, Command: RemoveAllScenes, Privilege: manage */ \ 0x00000004, /* Cluster: Scenes Management, Command: StoreScene, Privilege: manage */ \ + 0x00000040, /* Cluster: Scenes Management, Command: CopyScene, Privilege: manage */ \ 0x000000FE, /* Cluster: Thermostat, Command: AtomicRequest, Privilege: manage */ \ 0x00000000, /* Cluster: Fault Injection, Command: FailAtFault, Privilege: manage */ \ 0x00000001, /* Cluster: Fault Injection, Command: FailRandomlyAtFault, Privilege: manage */ \ @@ -503,6 +505,7 @@ chip::Access::Privilege::kManage, /* Cluster: Scenes Management, Command: RemoveScene, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Scenes Management, Command: RemoveAllScenes, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Scenes Management, Command: StoreScene, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Scenes Management, Command: CopyScene, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Thermostat, Command: AtomicRequest, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Fault Injection, Command: FailAtFault, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Fault Injection, Command: FailRandomlyAtFault, Privilege: manage */ \ diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h index acef1673384c14..c062b9376f4666 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h @@ -200,6 +200,7 @@ 0x00000062, /* Cluster: Scenes Management, Command: RemoveScene, Privilege: manage */ \ 0x00000062, /* Cluster: Scenes Management, Command: RemoveAllScenes, Privilege: manage */ \ 0x00000062, /* Cluster: Scenes Management, Command: StoreScene, Privilege: manage */ \ + 0x00000062, /* Cluster: Scenes Management, Command: CopyScene, Privilege: manage */ \ } // Parallel array data (cluster, *command*, privilege) for invoke command @@ -242,6 +243,7 @@ 0x00000002, /* Cluster: Scenes Management, Command: RemoveScene, Privilege: manage */ \ 0x00000003, /* Cluster: Scenes Management, Command: RemoveAllScenes, Privilege: manage */ \ 0x00000004, /* Cluster: Scenes Management, Command: StoreScene, Privilege: manage */ \ + 0x00000040, /* Cluster: Scenes Management, Command: CopyScene, Privilege: manage */ \ } // Parallel array data (cluster, command, *privilege*) for invoke command @@ -284,6 +286,7 @@ chip::Access::Privilege::kManage, /* Cluster: Scenes Management, Command: RemoveScene, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Scenes Management, Command: RemoveAllScenes, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Scenes Management, Command: StoreScene, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Scenes Management, Command: CopyScene, Privilege: manage */ \ } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/app/zap-templates/zcl/data-model/chip/scene.xml b/src/app/zap-templates/zcl/data-model/chip/scene.xml index ceea35e3759e69..fdd4a65c9cb29c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/scene.xml +++ b/src/app/zap-templates/zcl/data-model/chip/scene.xml @@ -169,6 +169,7 @@ limitations under the License. + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index b221a7526ca52f..aa2707931f36d6 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4272,7 +4272,7 @@ provisional cluster ScenesManagement = 98 { /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; + fabric command access(invoke: manage) CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** Attributes and commands for monitoring HEPA filters in a device */