Page MenuHomePhabricator

D9980.id33758.diff
No OneTemporary

D9980.id33758.diff

diff --git a/keyserver/src/fetchers/thread-fetchers.js b/keyserver/src/fetchers/thread-fetchers.js
--- a/keyserver/src/fetchers/thread-fetchers.js
+++ b/keyserver/src/fetchers/thread-fetchers.js
@@ -2,6 +2,7 @@
import invariant from 'invariant';
+import { specialRoles } from 'lib/permissions/special-roles.js';
import { getAllThreadPermissions } from 'lib/permissions/thread-permissions.js';
import {
rawThreadInfoFromServerThreadInfo,
@@ -97,7 +98,8 @@
const whereClause = filter ? constructWhereClause(filter) : '';
const rolesQuery = SQL`
- SELECT t.id, t.default_role, r.id AS role, r.name, r.permissions
+ SELECT t.id, r.id AS role, r.name, r.permissions,
+ r.special_role = ${specialRoles.DEFAULT_ROLE} AS is_default
`
.append(primaryFetchClause)
.append(
@@ -233,7 +235,7 @@
id: role,
name: rolesRow.name,
permissions: JSON.parse(rolesRow.permissions),
- isDefault: role === rolesRow.default_role.toString(),
+ isDefault: Boolean(rolesRow.is_default),
};
}
}

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 2:31 AM (21 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609335
Default Alt Text
D9980.id33758.diff (1 KB)

Event Timeline