Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3398639
D9980.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9980.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 2, 11:48 PM (20 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609335
Default Alt Text
D9980.diff (1 KB)
Attached To
Mode
D9980: [keyserver] Update usage of threads.default_role in thread-fetchers.js
Attached
Detach File
Event Timeline
Log In to Comment