|
Post by mharishm on Apr 28, 2022 8:03:30 GMT
Hi,
Let say user created creating custom role using POST /redfish/v1/AccountService/Roles with the payload as
{ "AssignedPrivileges": [ "ConfigureUsers", "ConfigureManager", "ConfigureSelf", "Login", "ConfigureComponents" ], "Id": "TestRole", "Name": "TestRole Role", "Description": "TestRole User Role", "RoleId": "TestRole" }
Once "TestRole" is created, user gives a PATCH call to update "AssignedPrivileges" without adding or deleting privilege but just rearranged the sequence order of the already assigned privilege as shown in the below payload.
PATCH /redfish/v1/AccountService/Roles/TestRole Payload: { "AssignedPrivileges": [ "ConfigureComponents", "ConfigureSelf", "ConfigureManager", "ConfigureUsers", "Login" ] }
Does the response of AssignedPrivileges in GET response (/redfish/v1/AccountService/Roles/TestRole) should follow the order provided in PATCH request body. Does redfish spec has any information about it.
Thanks, Harish M
|
|
|
Post by mraineri on Apr 29, 2022 14:47:55 GMT
The "PATCH on array properties" clause discusses these semantics. Arrays in JSON are ordered, so yes this would matter, especially when you factor in the aspects of using null and {} to remove or leave members alone in the array.
The way to interpret your PATCH example is "Replace index 0 with ConfigureComponents, replace index 1 with ConfigureSelf, replace index 2 with ConfigureManager, etc". I would expect this order to be preserved upon completion.
|
|