Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3398476
D9976.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
867 B
Referenced Files
None
Subscribers
None
D9976.diff
View Options
diff --git a/keyserver/src/fetchers/role-fetchers.js b/keyserver/src/fetchers/role-fetchers.js
--- a/keyserver/src/fetchers/role-fetchers.js
+++ b/keyserver/src/fetchers/role-fetchers.js
@@ -1,15 +1,16 @@
// @flow
+import { specialRoles } from 'lib/permissions/special-roles.js';
import type { RoleInfo } from 'lib/types/thread-types.js';
import { dbQuery, SQL } from '../database/database.js';
async function fetchRoles(threadID: string): Promise<RoleInfo[]> {
const query = SQL`
- SELECT r.id, r.name, r.permissions, r.id = t.default_role AS is_default
- FROM roles r
- LEFT JOIN threads t ON t.id = r.thread
- WHERE r.thread = ${threadID}
+ SELECT id, name, permissions,
+ special_role = ${specialRoles.DEFAULT_ROLE} AS is_default
+ FROM roles
+ WHERE thread = ${threadID}
`;
const [result] = await dbQuery(query);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 2, 11:08 PM (16 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609206
Default Alt Text
D9976.diff (867 B)
Attached To
Mode
D9976: [keyserver] Update usage of threads.default_role in role-fetchers.js
Attached
Detach File
Event Timeline
Log In to Comment