[=permission store entry/descriptor=] is |descriptor|, and whose [=permission store
entry/key=] [=permission key/is equal to=] |key| given |descriptor|, return that entry.
-
Let |parameters| be the |parameters| argument, converted to an IDL value of
+ type {{PermissionSetParameters}}. If this throws an exception, return an [=invalid
+ argument=] [=error=].
+
+
Let |rootDesc| be |parameters|.{{PermissionSetParameters/descriptor}}.
+
+
If |parameters|.{{PermissionSetParameters/state}} is an inappropriate permission
+ state for any implementation-defined reason, return a [=invalid argument=] [=error=].
+
+ For example, user agents that define the "midi" powerful feature as
+ "always on" can choose to reject a command to set the permission state to
+ {{PermissionState/"denied"}} at this step.
+
+
+
Let |typedDescriptor| be the object |rootDesc| refers to, converted to an IDL
+ value of |rootDesc|.{{PermissionDescriptor/name}}'s [=powerful
+ feature/permission descriptor type=]. If this throws an exception, return a [=invalid
+ argument=] [=error=].
+
+
+ [=Set a permission=] with |typedDescriptor| and |parameters|.{{PermissionSetParameters/state}}.
+
+ The [=remote end steps=] with |session| and |command parameters| are:
+
+
+
+ Let |descriptor| be the value of the `descriptor` field of
+ |command parameters|.
+
+
+ Let |permission name| be the value of the `name` field of
+ |descriptor| representing {{PermissionDescriptor/name}}.
+
+
+ Let |state| be the value of the `state` field of |command
+ parameters|.
+
+
+ If |state| is an inappropriate [=permission state=] for any
+ implementation-defined reason, return [=error=] with [=error code=] [=invalid argument=].
+
+
+ Let |typedDescriptor| be the object |descriptor| refers to, [=converted to an IDL value=] (|descriptor|, |state|) of
+ {{PermissionSetParameters}} |permission name|'s [=powerful feature/permission descriptor type=].
+ If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=].
+
+
[=Set a permission=] with |typedDescriptor| and |state|.