diff --git a/src/lib/db/access-store.ts b/src/lib/db/access-store.ts index 205f0b8764..43f2681927 100644 --- a/src/lib/db/access-store.ts +++ b/src/lib/db/access-store.ts @@ -43,6 +43,18 @@ interface IPermissionRow { } export class AccessStore implements IAccessStore { + private readonly DEPRECATED_PERMISSIONS = [ + 'CREATE_API_TOKEN', + 'UPDATE_API_TOKEN', + 'DELETE_API_TOKEN', + 'READ_API_TOKEN', + 'UPDATE_ROLE', + 'CREATE_ADMIN_API_TOKEN', + 'UPDATE_ADMIN_API_TOKEN', + 'DELETE_ADMIN_API_TOKEN', + 'READ_ADMIN_API_TOKEN', + ]; + private logger: Logger; private timer: Function; @@ -103,7 +115,9 @@ export class AccessStore implements IAccessStore { .orWhere('type', 'environment') .orWhere('type', 'root') .from(`${T.PERMISSIONS} as p`); - return rows.map(this.mapPermission); + return rows + .map(this.mapPermission) + .filter((p) => !this.DEPRECATED_PERMISSIONS.includes(p.name)); } mapPermission(permission: IPermissionRow): IPermission {