Skip to content

Commit

Permalink
Account for manufacturerCode in access.zapt.
Browse files Browse the repository at this point in the history
Unlike all other places that use .code, access.zapt was not accounting for
manufacturerCode.

Ideally this would just use the named ids instead of reinventing the id wheel,
but for now this at least makes the behavior match.
  • Loading branch information
bzbarsky-apple committed Jan 14, 2023
1 parent cae6319 commit d58eca8
Show file tree
Hide file tree
Showing 42 changed files with 4,236 additions and 4,236 deletions.
40 changes: 20 additions & 20 deletions src/app/zap-templates/templates/app/access.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
{{#if (isStrEqual role "view")}}
/* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "operate")}}
{{parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.parent.manufacturerCode parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "manage")}}
{{parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.parent.manufacturerCode parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "administer")}}
{{parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.parent.manufacturerCode parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else}}
ERROR: access has unrecognized role/privilege [ Cluster: {{parent.parent.name}}, Attribute: {{parent.name}} ]
{{/if}}
Expand Down Expand Up @@ -56,11 +56,11 @@
{{#if (isStrEqual role "view")}}
/* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "operate")}}
{{parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.manufacturerCode parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "manage")}}
{{parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.manufacturerCode parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "administer")}}
{{parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.manufacturerCode parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else}}
ERROR: access has unrecognized role/privilege [ Cluster: {{parent.parent.name}}, Attribute: {{parent.name}} ]
{{/if}}
Expand Down Expand Up @@ -126,9 +126,9 @@
{{else if (isStrEqual role "operate")}}
/* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "manage")}}
{{parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.parent.manufacturerCode parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "administer")}}
{{parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.parent.manufacturerCode parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else}}
ERROR: access has unrecognized role/privilege [ Cluster: {{parent.parent.name}}, Attribute: {{parent.name}} ]
{{/if}}
Expand Down Expand Up @@ -159,9 +159,9 @@
{{else if (isStrEqual role "operate")}}
/* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "manage")}}
{{parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.manufacturerCode parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "administer")}}
{{parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.manufacturerCode parent.code}}, /* Cluster: {{parent.parent.name}}, Attribute: {{parent.name}}, Privilege: {{role}} */ \
{{else}}
ERROR: access has unrecognized role/privilege [ Cluster: {{parent.parent.name}}, Attribute: {{parent.name}} ]
{{/if}}
Expand Down Expand Up @@ -227,9 +227,9 @@
{{else if (isStrEqual role "operate")}}
/* Cluster: {{parent.parent.name}}, Command: {{parent.commandName}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "manage")}}
{{parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Command: {{parent.commandName}}, Privilege: {{role}} */ \
{{asMEI parent.parent.manufacturerCode parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Command: {{parent.commandName}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "administer")}}
{{parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Command: {{parent.commandName}}, Privilege: {{role}} */ \
{{asMEI parent.parent.manufacturerCode parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Command: {{parent.commandName}}, Privilege: {{role}} */ \
{{else}}
ERROR: access has unrecognized role/privilege [ Cluster: {{parent.parent.name}}, Command: {{parent.commandName}} ]
{{/if}}
Expand Down Expand Up @@ -260,9 +260,9 @@
{{else if (isStrEqual role "operate")}}
/* Cluster: {{parent.parent.name}}, Command: {{parent.commandName}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "manage")}}
{{parent.code}}, /* Cluster: {{parent.parent.name}}, Command: {{parent.commandName}}, Privilege: {{role}} */ \
{{asMEI parent.commandMfgCode parent.code}}, /* Cluster: {{parent.parent.name}}, Command: {{parent.commandName}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "administer")}}
{{parent.code}}, /* Cluster: {{parent.parent.name}}, Command: {{parent.commandName}}, Privilege: {{role}} */ \
{{asMEI parent.commandMfgCode parent.code}}, /* Cluster: {{parent.parent.name}}, Command: {{parent.commandName}}, Privilege: {{role}} */ \
{{else}}
ERROR: access has unrecognized role/privilege [ Cluster: {{parent.parent.name}}, Command: {{parent.commandName}} ]
{{/if}}
Expand Down Expand Up @@ -326,11 +326,11 @@
{{#if (isStrEqual role "view")}}
/* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "operate")}}
{{parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.parent.manufacturerCode parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "manage")}}
{{parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.parent.manufacturerCode parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "administer")}}
{{parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.parent.manufacturerCode parent.parent.code}}, /* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{else}}
ERROR: access has unrecognized role/privilege [ Cluster: {{parent.parent.name}}, Event: {{parent.name}} ]
{{/if}}
Expand Down Expand Up @@ -359,11 +359,11 @@
{{#if (isStrEqual role "view")}}
/* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "operate")}}
{{parent.code}}, /* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.manufacturerCode parent.code}}, /* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "manage")}}
{{parent.code}}, /* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.manufacturerCode parent.code}}, /* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{else if (isStrEqual role "administer")}}
{{parent.code}}, /* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{asMEI parent.manufacturerCode parent.code}}, /* Cluster: {{parent.parent.name}}, Event: {{parent.name}}, Privilege: {{role}} */ \
{{else}}
ERROR: access has unrecognized role/privilege [ Cluster: {{parent.parent.name}}, Event: {{parent.name}} ]
{{/if}}
Expand Down
Loading

0 comments on commit d58eca8

Please sign in to comment.