diff --git a/app/realtime.php b/app/realtime.php index 96ee315776..adf5294e9b 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -269,7 +269,8 @@ if (!function_exists('setPermission')) { } } } - $document->setAttribute('$permissions', $permissions ?? []); + sort($permissions, SORT_STRING); + $document->setAttribute('$permissions', $permissions); } } diff --git a/src/Appwrite/Platform/Modules/Presences/HTTP/Action.php b/src/Appwrite/Platform/Modules/Presences/HTTP/Action.php index 8da53b34ee..45bfa1a35c 100644 --- a/src/Appwrite/Platform/Modules/Presences/HTTP/Action.php +++ b/src/Appwrite/Platform/Modules/Presences/HTTP/Action.php @@ -57,6 +57,7 @@ class Action extends PlatformAction } } + sort($permissions, SORT_STRING); $document->setAttribute('$permissions', $permissions); return $document;