Page MenuHomePhabricator

D9976.diff
No OneTemporary

D9976.diff

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

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)

Event Timeline